folly
17th May 2006 08:43 UTC
Write to text File
Apologies for this distraction. I ve searched the forum and read various tutorials but no clue.
I want to send some strings to a text file. if the file does not exist at the desired destination, then create it.
some of the text should be tab or comma separated in order to be read by an application.
e.g
"My Name " + tab separation + " This is just a test"
"My Address " + tab separation + " My address is not yet known"
etc
Any clue will be appreciated
JasonFriday13
17th May 2006 09:13 UTC
FileOpen, FileWrite, and FileClose in chapter 4.9.5 File Instructions of the NSIS manual should do the trick quite nicely. To use a tab in your string, put $\t where you want it.
folly
17th May 2006 12:18 UTC
thanks for this information
folly
17th May 2006 13:58 UTC
the tab symbol is not working pls. pls advise on usage
"Report_Directory $\t $R0/Report"
where $RO is the directory variable
Thnaks upfront
JasonFriday13
17th May 2006 23:22 UTC
This test code:
Name "j"
OutFile "File Write Test.exe"
Page instfiles
ShowInstDetails show
Section
FileOpen $0 "$DESKTOP\hello.txt" w
FileWrite $0 "Hello.$\tThis is tabbed.$\tTry and catch me.$\r$\nHello again.$\tTab.$\tTab.$\tTab."
FileClose $0
SetAutoClose false
SectionEnd
yields this output in hello.txt:
Hello. This is tabbed. Try and catch me.
Hello again. Tab. Tab. Tab.