[RESOLVED] Removing " marks from saved files
Hi all,
I currently save files from within VB like so:
Code:
Dim ABC as String
Dim FF as integer
FF = FreeFile()
ABC = "XYZ Any string here"
Open "C:\SavedFile.txt" for Output as #FF
Write #FF, ABC
Close #FF
This is fine, but it saves the strings with "" marks at tne beginning and end of the string. For example, in our sample file for this code, the text in the file would be:
"XYZ Any string here"
This is fine usually but I need to load the values without " marks. I know I can remove them during input, but I seem to remember that you can avoid that by using a different work wather than write to output the file. I tried print but it left massive gaps between the values (in the text file).
Any headsup on the word/method that I need to write the file without it having " marks? I've got a feeling I figured this out before, and it was just a simple word, but I can't find the code.
Thanks,
Arby.
Re: Removing " marks from saved files
Instead of
Write #FF, ABC
use
Print #FF, ABC
Re: Removing " marks from saved files
Ahh, I did try print, but for some odd reason it puts a load of spaces in after the value, for example:
Code:
"ABC", "ABCD", "ABCDE"
becomes
Any ideas?
Re: Removing " marks from saved files
VB Code:
Print #num, "hello"; Space(1); "bye"
Re: Removing " marks from saved files
When you separate the arguments with a comma the data is printed in the "next print zone".
Use the semi-colon instead
Print #1, "ABC"; "ABCD"; "ABCDE"
Note that with Print you need to actually print the comma to create a CSV file.
Re: Removing " marks from saved files
Ahh cool, thanks for the help people!