LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   Insert CRLF's with sed? (https://www.linuxquestions.org/questions/programming-9/insert-crlfs-with-sed-7651/)

unSpawn 10-17-2001 03:55 PM

Insert CRLF's with sed?
 
Im using DeleGate, the multiprotocol proxy, which supports rudimentary modifications to the traffic stream (similar to using netsed), tru usage of what they call "CFI Script". Now I would like to be able to break up stuff by inserting a lot of CRLF's.

The simplest solution would be to tag a html entity like x (read: ampersand,hashmark,1,2,0,semicolon) on, but ofcourse Wintendo will not allow for lower unicode chars at all, or translate this to "x". FWIW, Ive been able to use Bash (on windoze :-] ) and "tr" to piggyback a \120 or \130 on a stream, so I *know* thats possible, but CFI Script will allow only "sed" usage.

Hope the prev. is clear.
Q: *how* can I tag on a CRLF with sed?

TIA for any pointers!

isajera 10-17-2001 04:44 PM

ok... i'm not really sure what you're asking here... do you just need help with the sed command? it's going to be something like

sed 's/char/CRLF/g' infile > outfile

where char is what you want to replace with the CRLF's. if you want to add CRLF's without getting rid of the chars (or whatever)

sed 's/char/charCRLF/g' infile > outfile

naturally, of course, the CRLF's will be \n or whatever it is they're supposed to be. CRLF is carriage-return/linefeed... right?

unSpawn 10-18-2001 01:55 AM

Thnx, Isajera, What I need is a solution with sed to insert these Carriage return/Line feed control chars (think its unicode, right?) that *stick*. Using "\n" can't work IMO, because "\n" doesnt mean nothing to Wintendo when the stream gets there, and somehow I never could get the backslash escaped, how many escapechars I put in front of it :-]

So it's not the way *how* to insert chars, but *what* chars to insert :-]

*Can* sed even insert control chars so a Wintendo box can recognize em???

isajera 10-18-2001 08:35 PM

if memory serves correctly, ^M is the windows equiv of \n.

i'd test it out first, tho.

unSpawn 10-19-2001 03:22 AM

Thnx again for your ideas Isajera, Ill try that out.

lolmaker 11-20-2006 05:50 AM

^m;)













. . . . .

bigearsbilly 11-22-2006 07:46 AM

dos2unix unix2dos any good ??


All times are GMT -5. The time now is 02:19 AM.