C. Hatton Humphrey wrote:

> Does anyone have a quick way to trim extra lines from a text file?
> 
> I have an app that uploads a text file and processes it as a TSV file, but
> some users are exporting from MS Access, which is adding some extra line
> feeds to the end.  Any suggestions?


Read it, parse it, overwrite it.

Probably the best way to parse it would be a regular expression like:
<cfset text=REReplaceNoCase(text,"(^.*[^[:space:]])[[:space:]]*$","\1")>
(I believe linefeeds are in the space clase, could be control as well in 
which case you need to change accordingly.)

Jochem
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Get the mailserver that powers this list at http://www.coolfusion.com
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to