RE: Replace 0d with a space

"'Jennings, Kathryn' [email protected] [sed-users]" <[email protected]> Thu, 21 Jul 2016 20:29:00 +0000
Newsgroups gmane.editors.sed.user
Message-ID <A6FE880E28BA6247ACF8E4ACB27CD04452CC607D@A0185-XPO1016-C.ad.allstate.com>
Thank you for your help.  I will see if that will do it.


Thanks & Regards,


Kathryn Jennings
Electronic Commerce COE






From: [email protected] [mailto:[email protected]]
Sent: Thursday, July 21, 2016 11:03 AM
To: [email protected]
Subject: Re: Replace 0d with a space






* Kathryn Jennings [email protected]<mailto:[email protected]> [2016-07-21 17:45]:
> I have been trying to remove all 0d characters within a document
> with a space. I can delete the 0d using tr -d '\n' I cannot find
> anything that will help me replace it. I am thinking that sed is
> the correct command to use, but am unsure how to code the 0d character.


you might be looking for this (taken from sed1line.txt):


# IN UNIX ENVIRONMENT: convert Unix newlines (LF) to DOS format.
sed "s/$/`echo -e \\\r`/<file:///\\\r%60\>" # command line under ksh
sed 's/$'"/`echo \\\r`/<file:///\\\r%60\>" # command line under bash
sed "s/$/`echo \\\r`/<file:///\\\r%60\>" # command line under zsh
sed 's/$/\r/' # gsed 3.02.80 or higher


i wonder: why choose sed?
is this just a one-time job?
does it have to be automated?
does it have to be really fast?


for example, converting a single file i'd use the editor vim:


$ vim file
:%j
:x


these commands could be automated/scripted, of course.
but there are many tools out there which can do this.


Sven


--
Sven Guckes sig-sed @guckes.net GNU SED: 4.2.2 [2012-12-22]
SED Download: ftp://ftp.gnu.org/gnu/sed/<https://urldefense.proofpoint.com/v2/url?u=ftp-3A__ftp.gnu.org_gnu_sed_&d=CwQCAg&c=gtIjdLs6LnStUpy9cTOW9w&r=NAie2iwnZ7jxCSw-kth6IRs1psJ6bmT6MgPbxWPyXlo&m=j9O2dipETxtihLf04YZ9k2kLxk5Xr8w4qY4WG2aXjAM&s=MIrvICZ00srYDK2f2Ou4w6XP6vwBWNOTVZMzUPgcZ7E&e=> SED FAQ: http://go.to/sed-faq<https://urldefense.proofpoint.com/v2/url?u=http-3A__go.to_sed-2Dfaq&d=CwQCAg&c=gtIjdLs6LnStUpy9cTOW9w&r=NAie2iwnZ7jxCSw-kth6IRs1psJ6bmT6MgPbxWPyXlo&m=j9O2dipETxtihLf04YZ9k2kLxk5Xr8w4qY4WG2aXjAM&s=phXGlfT-sLs0swzU92beQDdrSfVwiMZ_TQWj7y5QdTE&e=>
SED One-Liners: http://sed.sf.net/sed1line.txt<https://urldefense.proofpoint.com/v2/url?u=http-3A__sed.sf.net_sed1line.txt&d=CwQCAg&c=gtIjdLs6LnStUpy9cTOW9w&r=NAie2iwnZ7jxCSw-kth6IRs1psJ6bmT6MgPbxWPyXlo&m=j9O2dipETxtihLf04YZ9k2kLxk5Xr8w4qY4WG2aXjAM&s=z0DuzcTR5yOV3UcVTMC0vAUtjG9wtl7siI-dVviNUII&e=> SEDSED: http://sedsed.sf.net<https://urldefense.proofpoint.com/v2/url?u=http-3A__sedsed.sf.net&d=CwQCAg&c=gtIjdLs6LnStUpy9cTOW9w&r=NAie2iwnZ7jxCSw-kth6IRs1psJ6bmT6MgPbxWPyXlo&m=j9O2dipETxtihLf04YZ9k2kLxk5Xr8w4qY4WG2aXjAM&s=8ORFx4iGJAEmurjhDF_IFdRrZ0yK-WViu89-jnl01zM&e=>
SED HomePage: http://www.gnu.org/directory/sed.html<https://urldefense.proofpoint.com/v2/url?u=http-3A__www.gnu.org_directory_sed.html&d=CwQCAg&c=gtIjdLs6LnStUpy9cTOW9w&r=NAie2iwnZ7jxCSw-kth6IRs1psJ6bmT6MgPbxWPyXlo&m=j9O2dipETxtihLf04YZ9k2kLxk5Xr8w4qY4WG2aXjAM&s=qZUp95Y8DKPW1U1lIIE1Vg7sv6OfPAAks0Ko80sk5FY&e=>






[Non-text portions of this message have been removed]