If this isn't exactly what you wanted, please try our Search (there's a LOT of techy and non-techy stuff here about Linux, Unix, Mac OS X and just computers in general!):
From: Jean-Pierre Radley <email@example.com> Subject: Re: ADD CR/LF TO FILE Date: Sat, 13 Oct 2001 00:48:30 GMT References: <firstname.lastname@example.org>
<9q81tu$n5aeh$1@ID-105888.news.dfncis.de> Bob Meyers propounded (on Fri, Oct 12, 2001 at 05:29:22PM -0700): | "Jim Mohr" <email@example.com> wrote in message | news:meLx7.3134$Y8.firstname.lastname@example.org... | | > "Dale Stover" <email@example.com> wrote in message | > news:firstname.lastname@example.org... | > | > > HI! I am looking for a unix utility that will copy a file blocked | > > at 2048 | > > with no end-of-record delimitor to a file that has records of 2048 | > > plus a cr&lf. | > | > Install Perl and stuff like this becomes 1 and two liners. | | If you have a c compiler, one could write a small c program to do | it. I don't no where I got it (some SCO product) but for many years I | have had a little filter set called "addcr" and "rmcr". I always copy | it to any new server I do. It is just like cat but adds/removes a CR | to NL. If you don't find a solution, email me and I'll send it along.
Well, your little program is not what he needs, because the file he has to work with has NO NEWLINES in the first place, so I suspect your addcr/rmcr would not do what he wants, which is to add a NL/CR after every 2048 bytes in the input. Your addcr/rmcr, though, is all done by my one single file called cr+-: : cr+- # adds CRs if not present, strips them if present # note: if you just cat this file, you miss its essence # if you cat -v this file, you see the _real_ ^Ms in it sed ' s-^M--g t s+$+^M+ t ' -- JP
Got something to add? Send me email.