Old 17th May 2006, 07:43   #1
folly
Junior Member
 
Join Date: May 2006
Posts: 4
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
folly is offline   Reply With Quote
Old 17th May 2006, 08:13   #2
JasonFriday13
Major Dude
 
JasonFriday13's Avatar
 
Join Date: May 2005
Location: New Zealand
Posts: 916
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.

"Only a MouseHelmet will save you from a MouseTrap" -Jason Ross (Me)
NSIS 3 POSIX Ninja
Wiki Profile
JasonFriday13 is offline   Reply With Quote
Old 17th May 2006, 11:18   #3
folly
Junior Member
 
Join Date: May 2006
Posts: 4
thanks for this information
folly is offline   Reply With Quote
Old 17th May 2006, 12:58   #4
folly
Junior Member
 
Join Date: May 2006
Posts: 4
the tab symbol is not working pls. pls advise on usage

"Report_Directory $\t $R0/Report"

where $RO is the directory variable

Thnaks upfront
folly is offline   Reply With Quote
Old 17th May 2006, 22:22   #5
JasonFriday13
Major Dude
 
JasonFriday13's Avatar
 
Join Date: May 2005
Location: New Zealand
Posts: 916
This test code:
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:
code:

Hello. This is tabbed. Try and catch me.
Hello again. Tab. Tab. Tab.


"Only a MouseHelmet will save you from a MouseTrap" -Jason Ross (Me)
NSIS 3 POSIX Ninja
Wiki Profile
JasonFriday13 is offline   Reply With Quote
Reply
Go Back   Winamp & Shoutcast Forums > Developer Center > NSIS Discussion

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump