[thelist] ASP Question - Parsing a string - Thanks! [WAS: RE: [thelist] Article validation on evolt.org?]

Martin Kuplens-Ewart martin at takingitglobal.org
Wed Mar 27 13:22:00 CST 2002


Tip... Payment for that botch-up...

<tip type="tab-delimited dump cleanup">
If you're doing a tab-delimited dump of data from a database, and the
data was captured from a textarea, chances are that you'll have a bunch
of tabs, newlines, carriage returns, etc. mixed in, which will all break
your t-d dump.

Within php, use the following to fix this, [replacing the carriage
returns, etc. with a double-space:

	$querydata[FieldName] = preg_replace("([\n\r\t])","
",$query[FieldName]);

The regexp should be adaptable/work in perl/whatever too...
</tip>

Hth anyone... At some point... I just spent 45 minutes trying to figure
out why my dump was busted, before writing that. :P

-martin





More information about the thelist mailing list