Hello,
I have a task that could be made much easier if I built a simple tool to parse through a CSV data pasted in a text area and it spits out specific the parts the name/value pairs I need. I do not have the luxury of a database and the data is a bit sensitive or else I would not be needing your fantastic assistance and I would have churned out some server-side magic.
Anyway, what is tripping me up is the necessity for regular expressions (and my lack of experience in this area in general), which can drive a man to drink. I can work with the code to get the specific parts I need and manipulate what is spit out to my specifications but its the starting point that I need help with.
I pasted a sample section of the data I need to parse through. I am pretty sure I can work with the data once it gets split into an array that can be searched through.
I appreciate any assistance on this matter.
Code:col1 col2,col3,col4,col5,col6 "head1", "cat1",1.58000%,000.10,2,724.11,11.64, "cat2",2.95000%,000.10,1,150.00,4.53, "cat3",1.73000%,000.10,3,1695.42,29.62, "cat4",1.05000%,000.15,5,589.79,6.95, "head2", "cat5",1.54000%,000.10,4,1400.08,21.96, "cat6",1.65000%,000.10,5,3287.84,54.74, "cat7",2.20000%,000.10,2,5030.40,110.86, "cat8",2.30000%,000.10,1,202.48,4.75, "cat9",1.20000%,000.00,1,834.46,10.01, "cat10",0.95000%,000.20,3,83.86,1.39, "cat11",1.75000%,000.20,3,729.18,13.36, "total",,,,,269.81,


Reply With Quote
. Try this:

Bookmarks