RE: [SLUG] Adding a carriage return after each line in a file.

From: bfoxworth@fortresstech.com
Date: Tue Jan 08 2002 - 15:14:56 EST


Can't you pipe it through sed and do a global search for all
0x0d and replace with 0x0d0x0a (whatever the octal values are)
The newline is a CR (0d) and for DOS mode you have to add a
LF (0a) after each CR. This may be do-able with tr also.
The script could ' cat oldfile | sed [arg] > newfile' However I
never tried doing it.

> Hi,
>
> Is it possible to add a carriage return after each line in a file? I know
> in vi you can use CTRL-V to add a <CR> but I'm not sure how to automate it
> to do it after each line. Each line is 856 bytes in size and corresponds
> to a record. Also is their a way to do this from a script so I can
> automate through cron every day. Thanks.
>
> Brett



This archive was generated by hypermail 2.1.3 : Fri Aug 01 2014 - 18:24:49 EDT