slynch401k
Registered User.
- Local time
- Today, 12:37
- Joined
- Feb 19, 2005
- Messages
- 10
I have a comma deliminated txt file that I am trying to import into a table. The problem is that random comments are in the text file. For example:
11113, Yes, No
;Comment Hello
12411,No,No
14325,Yes,No
;Comment Whatever
So I think that I need to actually read the file line by line and if the line starts with a ; delete it and add a comma and put it on the previous line so that I get the following:
11113, Yes, No ;Comment Hello
12411,No,No
14325,Yes,No ;Comment Whatever
Then output the file as a new text file so that it is in order and import it as a standard comma deliminated file.
Any ideas as to approaches would be appreciated. I can find alot of code on how to import text files and I will take a stab at it but no one has code that encounters this.
Thanks in advance
Steve
11113, Yes, No
;Comment Hello
12411,No,No
14325,Yes,No
;Comment Whatever
So I think that I need to actually read the file line by line and if the line starts with a ; delete it and add a comma and put it on the previous line so that I get the following:
11113, Yes, No ;Comment Hello
12411,No,No
14325,Yes,No ;Comment Whatever
Then output the file as a new text file so that it is in order and import it as a standard comma deliminated file.
Any ideas as to approaches would be appreciated. I can find alot of code on how to import text files and I will take a stab at it but no one has code that encounters this.
Thanks in advance
Steve
Last edited: