You are here:  » pre-sales questions


pre-sales questions

Submitted by trintek on Mon, 2007-04-02 20:14 in

I tried the online demo, but am having a problem.. I need to parse a csv that has 55 entries per record, when i tried the online demo, it breaks due to quotes, commas, and line breaks in certain fields. unfortunately these can't or won't be fixed on the client side. two examples of the data comprising 3 records are at the end of this post.

can Magic Parser handle either of these formats and return the correct number of fields? the end use is going to be parsing around 3000 records and either updating old records or inserting new ones into the database. I have the db code written, but have not found a decent way to parse the data they are providing.

CSV

"Hotel Valencia","Hotel Valencia","","","150 E Houston St","","San Antonio","TX","78205","(210) 227-9700","","(210) 227-9701","rakretschmer@valenciagroup.com","www.hotelvalencia.com","Hotel Valencia","Hotels/Motels","Banquet Facilities","Convention Services & Facilities","Hotels/Motels/Downtown Area","Hotels/Motels/Riverwalk Area","",06/03/2004,"W E M","CEO PLAT","NO",1022433,"Food, Beverage & Dining","Banquet Facilities","","Services","Convention Services & Facilities","","Lodging & Accommodations","Hotels/Motels","","Lodging & Accommodations","Hotels/Motels","Downtown Area","Lodging & Accommodations","Hotels/Motels","Riverwalk Area","","","",F,F,F,F,F,F,F,"213 rooms & Banquet","","Valencia hotel
"Small Luxury Hotels of the World," and
"Associated Luxury Hotels International",""

TSV

"A" "A" "" "" "215 W Any Rd Ste 114 No 412" "" "Boerne" "TX" "78006" "(555) 555-5555" "" "(555) 555-5555" "info@something.com" "http://www.something.com" "A" "Internet Services" "Website Design" "Website Development" "" "" "" 11/29/1999 "" "" "YES" 1017806 "Computers & Internet" "Internet Services" "" "Computers & Internet" "Website Design" "" "Computers & Internet" "Website Development" "" "" "" "" "" "" "" "" "" "" F F F F F F F "In business since 1999, A is SA's "Be Successful on the Web" experts and Beyond SEO (Search Engine Optimization).
Compelling dynamic websites, internet and e-mail marketing.
" "" "search engine marketing, website hosting, SEO consulting, email marketing" ""
"BTAC and "MGoM"" "BTAC and "MGo" "MGoM" "2030 N Any @ Any" "1515 Any Avenue" "" "San Antonio" "TX" "78208" "(555) 555-5555" "" "(555) 555-5555" "sales@something.com" "www.something.com" "BTAC and "MGoM"" "Caterers" "Banquet Facilities" "Gift Baskets" "" "" "" 09/27/2002 "W E M" "" "" 2416 "Food, Beverage & Dining" "Banquet Facilities" "" "Food, Beverage & Dining" "Caterers" "" "Retail" "Gift Baskets" "" "" "" "" "" "" "" "" "" "" F F F F F F F "Catering and banquet facilities also at "MGoM" Plus customized
gift baskets - Texas themes, Tamale Baskets, just about anything you want." "" "" ""
"HV" "HV" "" "" "150 E Any St" "" "San Antonio" "TX" "78205" "(555) 555-5555" "" "(555) 555-5555" "rakretschme@something.com" "www.something.com" "HV" "Hotels/Motels" "Banquet Facilities" "Convention Services & Facilities" "Hotels/Motels/Downtown Area" "Hotels/Motels/Riverwalk Area" "" 06/03/2004 "W E M" "CEO PLAT" "NO" 1022433 "Food, Beverage & Dining" "Banquet Facilities" "" "Services" "Convention Services & Facilities" "" "Lodging & Accommodations" "Hotels/Motels" "" "Lodging & Accommodations" "Hotels/Motels" "Downtown Area" "Lodging & Accommodations" "Hotels/Motels" "Riverwalk Area" "" "" "" F F F F F F F "213 rooms & Banquet" "" "V hotel
"Small Luxury Hotels of the World," and
"Associated Luxury Hotels International" ""

Submitted by support on Tue, 2007-04-03 07:01

Hi,

Magic Parser should be able to handle the format as provided above, but it may not autodetect correctly. I've pasted your sample CSV into the demo script which results in the following (using autodetection):

http://www.magicparser.com/demo?fileID=4611FACD0589F&record=1

It does show 55 fields, but I notice that there is a potential problem around about fields 54 and 55 - however this does correspond exactly with your sample CSV (note that he new line character will not show up in the HTML display) so this may be what is required...

Cheers,
David.

Submitted by trintek on Tue, 2007-04-03 21:16

hmmm, ok so i guess my main thing for right now will be working on pre-parsing the file to escape any potential problems... i worked up a rather ugly fix for it that seems to display correctly, but involves using an excel to mysql converter, doing str replacements in the resulting file, and removing all the useless stuff from it, then writing it to a csv file.. will probably need to check into a good excel reader class for php first.

thanks for the prompt reply
trin