× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



I think I may have not relayed my problem well enough. My problem is that
the new line (i.e. \n) isn't working - or any excaped character for that
matter.

For example, given the following content in /home/aaron/file1.txt:
-----------------------------------------------
This is a test to see if a new line will be created for each time the letter
i is found.
-----------------------------------------------

Now I run the following sed statement:
sed 's/i/\n/g' /home/aaron/file1.txt > /home/aaron/file2.txt

file2.txt now contains:
-----------------------------------------------
Thns ns a test to see nf a new lnne wnll be created for each tnme the letter
n ns found.
-----------------------------------------------

Note how it simply replaced all letter 'i' instances with 'n' instead of
creating a new line like it should have. Can somebody else run the same on
their system to see if I may need to load some PTF's? Note that I looked
for PTF's at Fix Central, but found none for sed.

I am at V5R3.

Thanks,
Aaron Bartell
http://mowyourlawn.com

-----Original Message-----
From: midrange-l-bounces@xxxxxxxxxxxx
[mailto:midrange-l-bounces@xxxxxxxxxxxx] On Behalf Of CRPence
Sent: Monday, November 19, 2007 1:35 PM
To: midrange-l@xxxxxxxxxxxx
Subject: Re: Using sed to replace all instances with a hex value

Try a variation of the message at the following archive link [where
its follow-up message gives correction to a comment]:
http://archive.midrange.com/midrange-l/200610/msg00656.html

For example:
qsh
cd /
sed 's/\r\n/\n/g' MyCRLFfile.txt > MyLFfile.txt

Regards, Chuck

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.