[ic] Cleaning carriage returns etc.
Thu, 12 Apr 2001 21:54:06 -0400
On Thu, Apr 12, 2001 at 04:51:36PM -0700, Ryan Hertz wrote:
> > > Hi list,
> > >
> > > I bumped in problems with a field that I clean from tabs, carriage returns
> > > etc. The formatting afterwards is not really what I want when I
> > > display the
> > > value somewhere...
> > >
> > > Can someone help me with some tips in what way <textarea> fields should be
> > > collected and stored (eg. tab replaced with 3 spaces etc.), in
> > > other words:
> > > what is safe to store in a tab-delimited file and what is not, and how
> > > should these characters be replaced/removed.
> The only TWO things a Tab-delimited file can't have stored as a record is a
> tab and a return (newline). :-) Specifically, a tab indicates a new field,
> and a newline indicates the end of the row.
Be clear about your goal. Are you removing tabs or is it tab delimited?
That seems to me like you are using the wrong tools for the job. A
TEXTAREA is almost always the wrong tool for data that depends on
white space. HTML is bad and TEXTAREA is the worst. Break it up
into multiple fields.
If you are uploading a tab delimited file, use a file upload. You
certainly cannot replace a tab with three spaces!
Christopher F. Miller, Publisher firstname.lastname@example.org
MaineStreet Communications, Inc 208 Portland Road, Gray, ME 04039
Content management, electronic commerce, internet integration, Debian linux