?
Solved

Copy a row from one text file to another text file

Posted on 2003-03-22
2
Medium Priority
?
128 Views
Last Modified: 2010-05-01
I want to write a function that copies one text file directly to the other text file in VB. The format for the source text file is like this:

"a",123,456,"b"
"c",234,567,"d"
...

There won't be a problem if I know what exactly are stored in the source file so that I can read the source file in to variables like this:

Input #1, var1, var2, var3...

So, like the above examples, the row can be like this : 123,456,"D",99999 or 444,555,666,111

I tried to read the whole row as a long string and then write the string back to the new file, however, the new file will not get the same result as quotation marks are added. So the result of:

"a",123,456,"b" will be written as """a"",123,456,""b""" in the new text file. So what should I do? (sorry for the long message above) Thanks a lot.
0
Comment
Question by:Naruto
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 28

Accepted Solution

by:
vinnyd79 earned 300 total points
ID: 8188376
when you write the string back to the new file use "Print" instead of "Write" and you wont get the quotation marks.
0
 

Author Comment

by:Naruto
ID: 8188938
Hey, vinnyd79, thanks a lot! it works!
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Suggested Courses
Course of the Month12 days, 4 hours left to enroll

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question