Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

Coding Forum


You are currently viewing our Coding Forum as a guest. Please register to participate.
Login



Reply
Parsing CSV Information
Old 05-25-2007, 06:26 PM Parsing CSV Information
Experienced Talker

Posts: 46
Trades: 0
Hello,

I am looking for a way to parse the information of a CSV file. Such as if I were to upload a file, I would want to collect the data to use in a link. Such as a file for contact information, I want to set this up to turn the information into a link like submit.php?name=bob&address=1234 .... but do not know how to deal with the file to get it into this format. Any help is appreciated.
bld44 is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 05-25-2007, 09:15 PM Re: Parsing CSV Information
Skilled Talker

Posts: 59
Trades: 0
What language are you using to parse the info?

Your going to want to use regular expressions to parse the data.
__________________

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE
riscphree is offline
Reply With Quote
View Public Profile Visit riscphree's homepage!
 
Old 05-29-2007, 05:49 PM Re: Parsing CSV Information
ForrestCroce's Avatar
Half Man, Half Amazing

Posts: 3,023
Name: Forrest Croce
Location: Seattle, WA
Trades: 0
If you're using .NET, and the CSV file doesn't have text fields marked with quotes ( "James Brown, Jr" as one field, not two ) String.Split is your friend.

First, I'd write something that would run through the file reading in bytes and breaking them apart into lines, then depending on your language, find a way to turn those lines into records with fields.
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
ForrestCroce is offline
Reply With Quote
View Public Profile Visit ForrestCroce's homepage!
 
Old 05-30-2007, 02:17 PM Re: Parsing CSV Information
willcode4beer's Avatar
Super Moderator

Posts: 1,533
Name: Paul Davis
Location: San Francisco
Trades: 1
If you use Java I'd recommend using Jakarta Commons CSV.
I used it for something else. There is a little on my site at:
http://willcode4beer.com/ware.jsp?set=swarmofideas
The source can be seen here:
http://i.willcode4beer.com/other/MTurkCsv2XML.html


If you are going to do the PHP/RegExp (please don't) path, take a look here:
http://www.roscripts.com/PHP_regular...mples-136.html
There is an example on that page CSV.

Due to the nature of the question, I'd recommend following Forrest's advice. You will learn much in the process.
__________________

Please login or register to view this content. Registration is FREE

willcode4beer is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Parsing CSV Information
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.43486 seconds with 12 queries