|
-
August 10th, 2000, 11:38 AM
#1
Carriage Returns/New Lines in file
I am trying to write a file that will be read on a UNIX box. The following code always writes a CR/NL combo at the end of each line:
dim i as integer
i = freefile
open "C:\TEXT.TXT" for output as i
print #i, "Hello there, World"
close #i
I have tried the following code but end up getting byte counts at the beginning of the line:
dim i as integer
i = freefile
Open "C:\text.txt" For Binary Access Write As #i
Put #i, , "Hello there, World" & Chr(10)
Close #i
Can somebody please explain to me if this is possible or not?
Thanks,
Mark
[email protected]
-
August 10th, 2000, 07:32 PM
#2
Re: Carriage Returns/New Lines in file
If what you are trying to do is eliminate the CRLF after each line replacing it with a NL try thie
print #i, "Hello there, World"; vblf;
Note the ; (semi-Colon) after the vbLF. This tells VB you are not finished with the current line and do not append a crlf after it. DO this for the entire file alwaays ending your print command with the ;
John G
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
|