Experience: is what you get soon after you need it.

Experience: is what you get soon after you need it.

****************I am authoring a Book on Oracle Database Cloud Services.......More details to follow.***************

Title : Oracle Database Cloud Revealed
Publisher : Apress
Release Date : Jan-2019

**********************************************************************************


Rasul Allah (sal Allahu alaihi wa sallam) said: "Restore the trusts of those who trust you, and deal not falsely with him who deals falsely with you." [Abu Dawud, Tirmidhi]


My Cloud Certifications:

AWS Certified Solutions Architect Associate

Oracle Cloud Infrastructure 2018 Certified Architect Associate.

Oracle Cloud Infrastructure Classic 2018 Certified Architect Associate.

Oracle Database Cloud Administrator Certified Professional.

Oracle Database Cloud Service Operations Certified Associate.

Search This Blog

Wednesday, July 13, 2011

remove ^M from files

if you want remove ^M characters from the files.


1) ftp the files using ascii mode

or

2) use dos2unix in Unix. (Most O.S should have this) if you don't

Then

3) use any of the below for one time .

cat filename |perl -pe 's/\015\012/\n/g' > filename.without.ctrl.m

or

This will do an inline edit of the file, if you wish to do every file in the directory
perl -p -i -e 's/^M//g' *

or

sed 's/^M//g' ${INPUT_FILE} > tmp.txt

mv tmp.txt ${INPUT_FILE}

or

tr -d "\15" < ${INPUT_FILE} > tmp.txt;

mv tmp.txt ${INPUT_FILE}

or)

For multiple files.

#!/bin/ksh
for f in `ls *.CSV` ###( change this .CSV to whatever file extensions you have)
do
mv $f ${f}~ && tr -d '\015\032' <${f}~ >$f
rm ${f}~
done

No comments: