Re: Not able to delete white spaces from file !! Please help



Hi
Infact it is not a DOS file . This file is created by multiple
eliminations of grep -v -e command on Unix System.

Now when i ran

#CR=`cat hh | tr hh '\15'`
#echo $CR
058AKZ 059AKZ 045AKZ A00008

So it is displaying as as single shell variable value which will not
suffice my requirement .

Kindly advice me how to solve this problem..

Many Thanks for help

Regards

Khurram



Stephane Chazelas wrote:
On 21 Jun 2006 03:07:28 -0700, Polani wrote:
Guys,

I have an input file which is having some white spaces in begining of
its some lines .
I have executed sed commands as well as tr commands as well as grep -v
"^$" against the file but no luck.
The file is as follows :
------------------------------------------------------------------------
058AKZ
059AKZ

045AKZ


A00008

-------------------------------------------------------------------------
[...]

Maybe that file is a MS-DOS like file, where every line ends in
a ^M character.

Try:

CR=`echo a | tr a '\15'`
grep "[^[:blank:]$CR]"

will return every line that contains any character that isn't a
blank nor a CR.

--
Stephane

.



Relevant Pages