Source language: Translate to:

End of line in ASCII files (Return)

NeoBook tips, tricks, code samples and more...

Moderator: Neosoft Support

End of line in ASCII files (Return)

Postby Jim Brammer » Thu Feb 07, 2002 5:04 pm

When we read a file to a variable with "all" parameter we get the content of file lines separated by a symbol that means "endofline" or "return".

If I want to join some variables and make a composed one separated by this symbol how can I make it?

Anyone knowing ? Thanks.

Frank


--------------------------------------------------------------------------------


Hi Frank,

If you wish to 'add' Return, use [#13].
Jim Brammer
 

End of line in ASCII files (Return)

Postby rcohen » Fri Mar 29, 2002 4:50 pm

I've run into the same problem here.... when trying to get a variable comprising of a single string and delimited by the | (from a previous function to a message box) to save to the clipboard variable, on separate lines.  Rather, I get the actual string with the embedded |  ;-(

Did you ever find the answer to this one Jim ?

rc :cool:
rcohen
 

End of line in ASCII files (Return)

Postby Ronnie » Sat Mar 30, 2002 1:57 am

Jim,

I think Dave has fixed this some time back when I was trying to load a file using the ALL parameter for my Photo project. Cannot remember the exact nature of the fix.. cos'
when the update was released.. the problem was gone.

(Edited by Ronnie at 11:57 am on Mar. 30, 2002)
Ronnie
 

End of line in ASCII files (Return)

Postby Jim Brammer » Sat Mar 30, 2002 1:09 pm

I'm not sure, but you may be misunderstanding the question or the problem here. The way I'm following it is like this...


This is the contents of FILE1:
File1, Line1
File1, Line 2

This is the contents of FILE2:
File2, Line1
File2, Line 2


When script is exec'd that looks like this...

FileRead "C:\FILE1.TXT" "ALL" "[Var1]"
FileRead "C:\FILE2.TXT" "ALL" "[Var2]"
SetVar "[Var3]" "[Var1][Var2]"
FileWrite "C:\OUTPUT.TXT" "ALL" "[Var3]"


... the output file will look like this

File1, Line1
File1, Line 2File2, Line1
File2, Line 2


...therefore, the [#13] ascii variable needs to be included to insert a CRLF at the lastmost line of the previous document

SetVar "[Var3]" "[Var1][#13][Var2]"


...so that the output looks correct like this

File1, Line1
File1, Line 2
File2, Line1
File2, Line 2
Jim Brammer
 


Return to NeoBook Knowledgebase

Who is online

Users browsing this forum: No registered users and 2 guests