open for append leaves additional characters. (1 Viewer)

Fuga

Registered User.
Local time
Today, 04:30
Joined
Feb 28, 2002
Messages
566
Hi,

I´m using the open for append method to write to a text file which is then converted to an xml file.

I loop through some lines in excel and for each line I´m writing it to the text file.

The problem is every string begins with " in the xml and ends with the return character. This means it doesn´t work as an xml file.

Does the write command leave these things or have I done something wrong?

Fuga.
 

boblarson

Smeghead
Local time
Yesterday, 19:30
Joined
Jan 12, 2001
Messages
32,059
Use PRINT instead of WRITE. PRINT won't encase strings in quotes.
 

Fuga

Registered User.
Local time
Today, 04:30
Joined
Feb 28, 2002
Messages
566
Thanks!

I´ll try that. Do you think that will help with the return character as well?

Fuga.
 

boblarson

Smeghead
Local time
Yesterday, 19:30
Joined
Jan 12, 2001
Messages
32,059
Yes, I believe it does (but I've been known to OCCASIONALLY be wrong ) :D
 

The_Doc_Man

Immoderate Moderator
Staff member
Local time
Yesterday, 21:30
Joined
Feb 28, 2001
Messages
27,300
PRINT verb is designed to print things to printers. The rule is generally that individual quotes get removed before the element is sent to the print buffer.

WRITE verb is designed to write things to files that won't necessarily be printed - but MIGHT be opened by Access later, or by another program. Think, if you will, about importing text files, where you have the option to specify that text fields will be enclosed in quotes. Then think about the quotes that enclose some fields as the result of a WRITE. Then try to decide how many coincidences you like in a single program.
 

Users who are viewing this thread

Top Bottom