|
-
March 4th, 2012, 05:41 PM
#4
Re: Convert csv to pipe delimited text
Converting a CSV file into a pipe delineated file should be simple and easy. The way I would approach is to write a lexer and parser for the csv file, process it into records, and then output those records into the format of your choice. For the lexer, you can have a class which iterates through all the characters in the file and keeps output tokens for the commas, the quotes, the text, and anything else that might pertain to csv format. I would also write a parser into which would be inputted the tokens, and this would verify the syntax and generate the records for the csv file. Outputting into a new format is a simple as writing the file. I might not be the wisest guy but I think that a simple search on lexing and recursive descent parsing will provide enough knowledge to achieve your goal.
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
|