-
March 22nd, 2011, 01:29 PM
#1
Csv File Reading
So my next task is to take a csv file with about 28 columns and parse the entire thing into a new file. Then I have a second csv file who has columns that overlap with the first one. These columns will not be parsed into the new csv file. The remaining columns in the second file will be parsed in though. So essentially I am merging the two files and only pulling the columns from the second one that don't exist in the first one. Can someone point me in the right direction on the best way to go about this? Thanks.
-
March 22nd, 2011, 02:17 PM
#2
Re: Csv File Reading
Copy the second file, and edit the fields that you want, and delete the others.
Or, just parse them both, but only use the fields that you want.
You'd have to SPLIT() the text file into lines, then into fields, and then parse into a new record.
Not really difficult, but might be more than a simple task
-
March 22nd, 2011, 02:23 PM
#3
Re: Csv File Reading
That's a good idea about deleting the columns, but I think this has to be completed automated so it will be able to pull the files from their locations, perform the functions needed, and then probably upload them to the desired location. I'm not sure though. Do you have some links to any examples of splitting the contents of csv files btw? Thanks for the reply.
-
March 22nd, 2011, 03:03 PM
#4
Re: Csv File Reading
Ok, I set it up so it iterates through all files in the folder and printed the contents of them into one large output file. I then deleted the columns I don't need from the second file. My next step is to set it up so it references the customer id column in the output file and matches it to the corresponding row in the second file and then add the columns for that row into the output file.
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
|