in reply to Re^4: Trim Two Characters On Line
in thread Trim Two Characters On Line

No SSCCE or example data accompanies your latest problem statement, so let me reiterate the good advice offered by hippo here. However, please do not post 80-plus field CSV (if that's what you're dealing with) records; 6-12 reasonably-sized fields and a reasonable length threshold should be enough.

Be that as it may, it's possible to guess at what your problem may be. You do not chomp your records when you read them; there's still a newline at the end of the record. If a record exceeds the limiting number of CSV (?) fields, two characters will be trimmed from the end of the record, and one of them will be the newline. The trimmed, newline-less record is then written to the output file. The next record written to the output file will be effectively concatenated with the previous (newline-less) record, and you have apparent line-wrap.


Give a man a fish:  <%-{-{-{-<