Have to create a new file

Hi,
I'm having a file like below

'ACAA0A00003277MT'


'ACAA0A00003277MV'


'ACAA0A00003277LP'

I need the file with above contents with no space like below

'ACAA0A00003277MT'
'ACAA0A00003277MV'
'ACAA0A00003277LP'

I used the command

grep -v '^$' tmp>tmp1

but its not working

Please help me on this

Regards
Thelak

 cat temp.txt | sed   /'^$'/d

This should also work :

cat temp.txt | grep -v  '^$'

Its not working,still it shows the file with space only
regards
Thelak

wat is the o/p of the following command for u :

grep -v '^$' tmp 

where tmp is the original file containing data and spaces.

yes tmp is original file which containing the data and spaces

'ACAA0A00003277AF'


'ACAA0A00003277L1'


'ACAA0A00003277AX'


'ACAA0A00003277B3'


'ACAA0A00003277L0'


'ACAA0A00003277AO'

I showed the samples its again and again displaying with spaces

Try:

awk NF file
1 Like

fabolus

Thanks alot

regards
Thelak

this will work

grep -v "^$" temp > temp1

That didn't work for the OP, please reread the 1st post of this thread.

this command worked....

$ > cat papa
'ACAA0A00003277MT'

'ACAA0A00003277MV'

'ACAA0A00003277LP'
$ > grep -v "^$" papa > temp
$ > cat temp
'ACAA0A00003277MT'
'ACAA0A00003277MV'
'ACAA0A00003277LP'

please try