Computing.Net > Forums > Unix > Help removing returns from lime

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Help removing returns from lime

Reply to Message Icon

Name: sting013
Date: November 30, 2005 at 13:34:52 Pacific
OS: solaris
CPU/Ram: ?
Comment:

Hello all I have a file that looks like this.
176409|L02|330.0||1198|820|2392|00|4620|80|Optional Housing Fee: Two Person, Two Bedroom Super Suite|0|0|CL|||||$
178190|OT3|2500.0||1198|318|3608|00|4620|25|Gold\$
|1|12|AC|||||$
175867|E01|70.0||1198|318|1604|00|4620|25|Masonry Design Software|17|999|AC|||||$
178591|050|0.0||1198|314|2342|00|4610|10|1262-L Flicks on Friday\$
|0|40|AC|TEMPLE ISRAEL||||$
178591|051|0.0||1198|314|2342|00|4610|10|1263-L Introduction to Drawing|0|15|AC|THE KENWOOD||||$
178591|052|0.0||1198|314|2342|00|4610|10|1264-L Computer Basics|0|19|AC|CECC||||$

I need to remove the carraige return when ever this is a \ at the end of the line
I have been tring to use sed but been unable to make it work. I belive the $ is the carraige return.
Thanks for any help



Sponsored Link
Ads by Google

Response Number 1
Name: jlemieux
Date: December 5, 2005 at 07:51:45 Pacific
Reply:

Try this. It should output in the format you desire.

#!/bin/ksh

exec 3< ./junk.data

while read -ru3 line
do
if [[ $line = *\\ ]]
then
IFS="$IFS\\"
outline=$line
else
outline=$outline$line
print -r $outline
unset outline
fi
done


0

Response Number 2
Name: FishMonger
Date: December 5, 2005 at 09:23:02 Pacific
Reply:

perl -ni -e 'chomp if /\\$/'


0

Response Number 3
Name: sting013
Date: December 7, 2005 at 11:28:33 Pacific
Reply:

Thanks I will give it a try tonight


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Unix Forum Home


Sponsored links

Ads by Google


Results for: Help removing returns from lime

How to Remove LILO from Windows NT boot www.computing.net/answers/unix/how-to-remove-lilo-from-windows-nt-boot-/2230.html

Removing LILO from Windows NT boot secto www.computing.net/answers/unix/removing-lilo-from-windows-nt-boot-secto/2229.html

remove ^M from a file www.computing.net/answers/unix/remove-m-from-a-file/7537.html