Skip to content
⌘ NSIS Forum Archive

DetailPrint & FileRead

5 posts

glory_man#

DetailPrint & FileRead

I have text file - history.txt -

qwert
asdfg
zxcvb
poiuy
lkjhg
mnbvc
Inside section read all its strings:

SetDetailsPrint both
ClearErrors
FileOpen $0 "f:\test\history.txt" r
IfErrors readok
read:
FileRead $0 $1
ifErrors readok
DetailPrint $1
MessageBox MB_OK|MB_ICONSTOP "$1"
goto read
FileClose $0
readok:
MessageBox show normal message. But in listbox of instfiles-page i see 2 symbols after every line of history.txt except last line (see attached file).

How can I fix it (remove these symbols)?
Thanks in advance.
deguix#
Those are probably the $\r$\n characters. You have to use a function that trims those characters. You can find it on Include\StrFunc.nsh, or on Archive.
Afrow UK#
You can find the TrimNewLines function in the docs:


-Stu