[CALUG] Reading CSV using Python / PHP

mike vore mvore at verizon.net
Thu Apr 28 11:27:51 EDT 2016


Sounds like something I did many years ago, probably in AWK. My source code
might be on 5.25 floppies - APPLE CPM format. I did say MANY years ago.

If I were starting from scratch in two steps:
find the multi line records - make them into long lines
parse on ^" (beginning of line, "," and '$ (end of line). and do your
processing on each line.

p.s. those 5.25 are now residing in the land-fill






On 04/28/2016 10:36 AM, Rajiv Gunja wrote:
> Hey all, I am trying to cut down on the amount of manual steps I have to take
> editing CSV file - sorting, creating new tabs and categorising them.
> I googled and found logparser from MS, could not figure it out - maybe a
> mental block towards anything MS. 
> 
> I saw that it was possible using python or PHP. So turning to you guys for
> advice. Which one works best or is there a different way?
> 
> I do not know Python, but I can learn. PHP, I am very familiar with, but
> whichever is efficient and can do a better job, I will use it.
> 
> Problem: 
> 1. CSV file has 2000+ rows
> 2. Some columns are multi-line with \r and \n
> 3. fields are separated by "," and each data item is between quotes (" ")
> 
> Please let me know.
>  
> -GG
> 
> 
> _______________________________________________
> CALUG mailing list
> CALUG at unknownlamer.org
> http://lists.unknownlamer.org/listinfo/calug
> 



More information about the CALUG mailing list