How to remove ("") in text file using VB?
Hi, i am a beginner on Visual Basic. I use
open "test.txt" for output as #1
write #1, "testing"
close #1
but the text file is ("testing"). How can i remove the ("")
Thx a lot of! ^^
There''s a number of different ways a file can be opened, check up on the VB help for Open.
For more control, it''s sometimes better to open the file in binary mode:
''don''t hardcode file handle numbers e.g. #1,
''better to use freefile to give you an available handle
Dim hFile As Long
hFile = FreeFile
Open "test.txt" For Binary Access Write As #hFile
Put #hFile, , "testing"
Close #hFile
In binary you will have to put in things like carriage return line feed characters yourself, e.g.:
Put #hFile, , "testing1" & vbCrlf
Put #hFile, , "testing2" & vbCrlf
For more control, it''s sometimes better to open the file in binary mode:
''don''t hardcode file handle numbers e.g. #1,
''better to use freefile to give you an available handle
Dim hFile As Long
hFile = FreeFile
Open "test.txt" For Binary Access Write As #hFile
Put #hFile, , "testing"
Close #hFile
In binary you will have to put in things like carriage return line feed characters yourself, e.g.:
Put #hFile, , "testing1" & vbCrlf
Put #hFile, , "testing2" & vbCrlf
Personally, I use
print #1, "testing"
Which works fine.
All your bases belong to us (I know. It''s irony.)
print #1, "testing"
Which works fine.
All your bases belong to us (I know. It''s irony.)
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement