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

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

****************Got the opportunity to pen a Book on Database Cloud Services.......More details to follow.***************

Title : Database Cloud Revealed
Publisher : Apress
Release Date : Jan-2020

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


My Cloud Certifications:

AWS Certified Solutions Architect Associate

Azure Certified Architect

Azure Certified Administrator

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: