Gossamer Forum
Home : General : Perl Programming :

Removing 'returns' (binary) from a flat text file

Quote Reply
Removing 'returns' (binary) from a flat text file
hey guys,

Need a little help, I saw somehwere a program that would remove the unwanted returns in a flat data text file.

Help would be appreciated in locating one that would remove them.

Thanks


------------------
MRaburn
Raburn Networks
www.raburn.net
Site Hosting-Design/Customize Scripts/Graphic Artwork

Personal Site:
The Mustang Network
www.stangnet.com
My UBB:
www.raburn.net/stangnet/bb/Ultimate.cgi
My Links Page:
www.stangnet.com/links2

Quote Reply
Re: Removing 'returns' (binary) from a flat text file In reply to
Are you trying to remove linefeeds/returns from input before you write it to a datafile? If so just use:

$input =~ s/\n//g;
$input =~ s/\r//g;

Cheers,

Alex
Quote Reply
Re: Removing 'returns' (binary) from a flat text file In reply to
Alex,

Thanks for the tip.

Do you know of a short script that would open a text file and remove ALL the unwanted returns that are now all thorughout the data?

Thanks