Writing a line in to a file

  • Thread starter Sridhar P via OfficeKB.com
  • Start date
S

Sridhar P via OfficeKB.com

Hi

I am writing a line (text) from file 1 to file 2. I am reading a line from
file 1 and writing in to file 2 using the below code. The line in file 1 is
appended with double quotes (") and then written in to file 2. Can anybody
suggest me a way to avoide this double quotes.

For Ex:
If file 1 has the sentance - This is line in file 1
then file 2 will be - "This is line in file 1"

Thanks in advance
Sridhar P


Code
-------

Sub SplitFile()

Dim InputData

Open "C:\inpfile.txt" For Input As #1

Open "C:\outfile.txt" For Output As #2

Line Input #1, InputData

Write #2, InputData

Close #2

Close #1

End Sub
 
G

Guest

Write # delimits the output with "" and commas; use Print# instead to send
the data to the file exactly as you have specified it in your code.
 
S

Sridhar P via OfficeKB.com

Hi Friends,

Thanks for the solution.... It serves my purpose...

Thanks
Sridhar P
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top