|
Posted by Disco Octopus on 10/26/05 04:35
Michel Beaussart wrote:
> Hi all,
>
> Not being a web developper, I will try to explain in few words the problem,
> I just encountered.
> A form contains a textarea elements, multilined. When processed the form is
> send to be saved into a csv file (using php) and the result is somewhat of a
> mess.
> Some lines would be perfect, while others would have a line break in the
> middle (two or three times..) making the process of the file impossible.
> I was wondering if there was a sort of conditioning possible to textarea to
> avoid this kind of behavior.
> Thank you for your help...
> !!
Depending on what you want to do with the resulting CSV, you may consider
these things???...
1. Place quotes ( "" ) around the data in the CSV column. Some CSV
interpreters look for columns delimited by these.
2. When you are creating you CSV file from the uploaded test in your
textarea, your may do a serach-replace newlines for "special string" of
some kind. This would only be effective if you are interpreting the CSV in
either your own CSV view/reader, or your CSV gets published with special
instructions on how to interpret newlines --> "special string"
3. Instead of "NewLine" as the EndOfRecord flag, your may use something
else such as "<NewLine>+<SpecialString>". Of course as above, you will need
to instruct your interpreters to understand the next record flag.
--
a beef jerky web site : http://www.choicebeefjerky.com.au
not a beef jerky web site : http://mycoolwheels.com/vote.cmks
if the oil light is on, dont think it will just go away
[Back to original message]
|