TCLUG Archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [TCLUG:10735] FromDOS?



I think it is something easy like:

------------------------
#!/usr/local/perl -w
# unix2dos
while (<>) {
	s/\n/\n\r/g;
}
------------------------
#!/usr/local/perl -w
# dos2unix
while (<>) {
	s/\r//g;
}
------------------------

but it could probably be found in a perl book or doc somewhere.

Good luck,

Troy

Callum Lerwick wrote:
> 
> Mike Hicks wrote:
> >
> > I'm looking for a script (in Perl, probably) to convert DOS text (CRLF)
> > into UNIX text (LF?)..
> >
> > anyone have one?
> 
> Hmmm. Back in my slackware days there was dos2unix or something like
> that. RedHat doesn't seem to have it... :P