How to read an text file line by line in NSIS


This is just a small snippet to guide how to read text file by every line in NSIS
NSIS support instruction FileRead to read the line of a file, we just use it in a loop

FileOpen $0 $INSTDIR\file.dat r
LOOP:
IfErrors exit_loop
FileRead $0 $1
DetailPrint $1
Goto LOOP
exit_loop:
FileClose $0

3 thoughts on “How to read an text file line by line in NSIS

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.