5 replies
by result
The Write # statement writes data in a consistent and fixed format, which ensures the data can be read in any locale. If this is not the behavior you want, you can use Print #, which will write data to a sequential file as it would appear on the screen. For example:
Open "C:\MyTest.txt" For Output As #1
Write #1, "Test String with Write"
Print #1, "Test String with Print"
Close #1
If you were to open up MyTest.txt in Notepad, the output would be:
"Test String with Write"
Test String with Print
by awilliams3
Review the following Microsoft Knowledge Base article:
XL: Procedure to Export Text File with Comma AND Quote Delimiter
http://support.microsoft.com/support/kb/articles/Q123/1/83.asp?LN=EN-US&SD=gn&FR=0
Though the article is written for Excelthe code itself demonstrates the importing of a text file with multiple delimiters. With the exception of depositing the data to a worksheet this code will work in Visual Basic, changing the destination of the imported text to a control, a databasetable, or even a worksheet, etc.
This discussion is closed to new replies.
Trending Web Development posts
Sort by Trending