Why is VB putting quotes around strings inputted to a text file?

OliverS
OliverS used Ask the Experts™
on
Why is VB putting quotes around strings inputted to a text file?  How can I append a .txt file without VB putting quotes around the lines, and also put a CrLf at the end of the file so it doesn't put data on the same line twice?

Here's the code:

Private sub cmdMove855()
     dim i as integer
     AcctIndex = 0
     Open "C:\EDI\AcctInfo.txt" for input as #1
       Do until EOF(1)
         Line input #1, strLineData
         arrAccoutInfo(AcctIndex) = strLineData
         AcctIndex = AcctIndex + 1
         AcctMaxIndex = AcctIndex
       loop
     close #1
     Open "C:\EDI\AppendFile.txt" for append as #2
       For i = 0 to AcctMaxIndex -1
         write #2, arrAccountInfo(i)
       next
     close #2
end sub

Please tell me how to get rid of the quotes! And insert a carriage return at the end!
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®

Commented:
Use print instead of write


ie.

Print #2, arrAccountInfo(i)
Commented:
Replace:
        write #2, arrAccountInfo(i)
with:
        print #2, arrAccountInfo(i)

Write will add quotes around items; Print will not

By omitting the trailing ";" on the print, you will also get a CR/LF added

 

Author

Commented:
Thanks, a simple answer to a simple question that I couldn't quite figure out.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial