Archived

This topic is now archived and is closed to further replies.

wah_on_2

How to remove ("") in text file using VB?

Recommended Posts

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! ^^

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites