|
-
Jul 30th, 2003, 10:20 AM
#1
Thread Starter
Addicted Member
Can't stop writing these stupid """"
I think my problem is that I'm trying to write a string to a text file, and VB must automatically add the "" to the front and back of any string when writing it to a text file. Is there a way to keep this from happening? I tried trimming the quotes off before writing but no luck. Maybe I'm doing something wrong.
VB Code:
Dim textfileData As String
Open Filename For Output As #1
textfileData = Replace(textfileData, Chr$(34), "")
Write #1, textfileData
Close #1
Any suggestions?
Place Your VBForums Ad Here
-
Jul 30th, 2003, 10:25 AM
#2
Use Print instead of Write.
-
Jul 30th, 2003, 10:25 AM
#3
-
Jul 30th, 2003, 10:26 AM
#4
Frenzied Member
It is the write commant.. Use Print instead..
Rudy
10 different ways to skin a cat and amazingly enough each and every one has the same result, the cat gets skinned! The same can be applied to code, so be nice and accept each others "preferences".
-
Jul 30th, 2003, 10:31 AM
#5
Thread Starter
Addicted Member
Wow, so freaking easy. Thanks for all the replies guys. Is there a situation where you would ever choose Write over Print?
Place Your VBForums Ad Here
-
Jul 30th, 2003, 10:32 AM
#6
If you want the quotes! LOL
-
Jul 30th, 2003, 10:33 AM
#7
Frenzied Member
10 different ways to skin a cat and amazingly enough each and every one has the same result, the cat gets skinned! The same can be applied to code, so be nice and accept each others "preferences".
-
Jul 30th, 2003, 10:34 AM
#8
heh. Well there may be a logical reason, but I don't have a clue.
-
Jul 30th, 2003, 10:40 AM
#9
Frenzied Member
Originally posted by Cander
heh. Well there may be a logical reason, but I don't have a clue.
The only possible reason I can come up with is that you are Appending to an existing file and want to be able to sort out what was written by the program from the origional text..
10 different ways to skin a cat and amazingly enough each and every one has the same result, the cat gets skinned! The same can be applied to code, so be nice and accept each others "preferences".
-
Jul 30th, 2003, 10:49 AM
#10
Frenzied Member
If your information is likely to have commas in it then you are better off encapsulating everything in " because otherwise anything reading your CSV file later will get confused otherwise.
'Buzby'
Visual Basic Developer
"I'm moving to Theory. Everything works there."
-
Jul 30th, 2003, 10:54 AM
#11
Thread Starter
Addicted Member
I see your point but in my case my CSV is actually a semi-colonSV file. If you delimitter is anything other than a comma, it's kind of silly I think
Place Your VBForums Ad Here
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|