Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game. |
| Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
 |
GNU/Linux Basic Guide
This 255-page guide will provide you with the keys to understand the philosophy of free software, teach you how to use and handle it, and give you the tools required to move easily in the world of GNU/Linux. Many users and administrators will be taking their first steps with this GNU/Linux Basic guide and it will show you how to approach and solve the problems you encounter.
Click Here to receive this Complete Guide absolutely free. |
|
 |
10-17-2001, 03:55 PM
|
#1
|
|
Moderator
Registered: May 2001
Posts: 24,970
|
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!
|
|
|
|
10-17-2001, 04:44 PM
|
#2
|
|
Senior Member
Registered: Jun 2001
Location: San Antonio, TX
Distribution: distro? what's a distro?
Posts: 1,635
Rep:
|
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?
|
|
|
|
10-18-2001, 01:55 AM
|
#3
|
|
Moderator
Registered: May 2001
Posts: 24,970
Original Poster
|
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???
|
|
|
|
10-18-2001, 08:35 PM
|
#4
|
|
Senior Member
Registered: Jun 2001
Location: San Antonio, TX
Distribution: distro? what's a distro?
Posts: 1,635
Rep:
|
if memory serves correctly, ^M is the windows equiv of \n.
i'd test it out first, tho.
|
|
|
|
10-19-2001, 03:22 AM
|
#5
|
|
Moderator
Registered: May 2001
Posts: 24,970
Original Poster
|
Thnx again for your ideas Isajera, Ill try that out.
|
|
|
|
11-20-2006, 05:50 AM
|
#6
|
|
LQ Newbie
Registered: Nov 2006
Posts: 12
Rep:
|
^m
. . . . .
|
|
|
|
11-22-2006, 07:46 AM
|
#7
|
|
Senior Member
Registered: Mar 2004
Location: england
Distribution: FreeBSD, Debian, Mint, Puppy
Posts: 3,211
Rep: 
|
dos2unix unix2dos any good ??
|
|
|
|
| Thread Tools |
Search this Thread |
|
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -5. The time now is 02:04 AM.
|
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|