You are here:  » problem with end of lines


problem with end of lines

Submitted by cajrix on Sun, 2008-12-07 13:04 in

hi, got some csv files with pricelists and product descriptions, problem is
that when i parse a csv with magicparser i cannot find a way how to replace end of line with tag.
function nl2br isnt working, looks like magicparser removes end of lines.
Is this possible?
when i open csv file in open office i can see that description is ok.

for example

open office

15 db antenna
size 60x60 cm
weight 100g

magic parser

15 db antenna size 60x60 cm weight 100g

all is like 1 line text and i cannot format it.
any idea?

Submitted by support on Sun, 2008-12-07 13:08

Hi,

I take it you have a CSV feed that has a description field containing new-lines; and therefore it is delimited somehow - probably with quotation marks.

This should be handled correctly by Magic Parser (one of the benefits of using Magic Parser over a fgetcsv is multi-line record support within CSV files) so I'd need to have a look at the raw data to work out what's happening here for you.

Could you perhaps email me the csv file (zipped if it's large) or alternatively a link to where I can download the file from and I'll check it out for you...

Also a snippet of your PHP script, in particular your call to MagicParser_parse() and your record handler function would be useful...

Cheers,
David.