Add a new field at the end of each line

i want to add a white-space at the end of each line for my inp.file, but when i do it, the result is a new line with a white-space between each line!

my input:

 
 2012 0811 1223 15.2 L  38.393  46.806  9.0  Teh 78 0.5 6.5LTeh                1 
 GAP=74                                                                        E 
 Iranian Seismological Center, Institute of Geophysics, University of Tehran   6 
 STAT SP IPHASW D HRMM SECON CODA AMPLIT PERI AZIMU VELO SNR AR TRES  W DIS CAZ7 
 MHD  SN E    0   1225 41.58    278118.0  0.8                           0.0   0 
 VIS  SE E    0   1225 35.81    916098.0 1.28                           429 179 
 KFM  BZ E    0   1226 23.74       -99.0 3.64                           548 170 
 GLO  SZ E    0   1226 18.91     92061.7  0.8                           656 107 
 RAZ  SN E    0   1225 34.17    127538.0 0.68                           0.0   0 
 GZV  SE E    0   1225 23.49    448179.0  0.6                           0.0   0 
 GZV  SZ E    0   1225  9.53    271464.0 0.68                           375 125 

my awk script:

awk '{print $0," "}' in > out

result:

   
 2012 0811 1223 15.2 L  38.393  46.806  9.0  Teh 78 0.5 6.5LTeh                1
   
 GAP=74                                                                        E  
 
 Iranian Seismological Center, Institute of Geophysics, University of Tehran   6  
 
 STAT SP IPHASW D HRMM SECON CODA AMPLIT PERI AZIMU VELO SNR AR TRES  W DIS CAZ7  
 
 MHD  SN E    0   1225 41.58    278118.0  0.8                           0.0   0  
 
 VIS  SE E    0   1225 35.81    916098.0 1.28                           429 179  
 
 KFM  BZ E    0   1226 23.74       -99.0 3.64                           548 170 
  
 GLO  SZ E    0   1226 18.91     92061.7  0.8                           656 107 
 
 RAZ  SN E    0   1225 34.17    127538.0 0.68                           0.0   0 
 
 GZV  SE E    0   1225 23.49    448179.0  0.6                           0.0   0 
 
 GZV  SZ E    0   1225  9.53    271464.0 0.68                           375 125
 

anybody knows about this problem? i used SL Linux V6.3 32bit

use tr and then try awk something like this

$ tr -s '\n'  <file | awk '$0=$0" "'

unfortunately "tr" does not work on my OS!

Hi,
you can try as here:

$ cat -A inp.file
 $
 2012 0811 1223 15.2 L  38.393  46.806  9.0  Teh 78 0.5 6.5LTeh                1 $
 GAP=74                                                                        E $
 Iranian Seismological Center, Institute of Geophysics, University of Tehran   6 $
 STAT SP IPHASW D HRMM SECON CODA AMPLIT PERI AZIMU VELO SNR AR TRES  W DIS CAZ7 $
 MHD  SN E    0   1225 41.58    278118.0  0.8                           0.0   0 $
 VIS  SE E    0   1225 35.81    916098.0 1.28                           429 179 $
 KFM  BZ E    0   1226 23.74       -99.0 3.64                           548 170 $
 GLO  SZ E    0   1226 18.91     92061.7  0.8                           656 107 $
 RAZ  SN E    0   1225 34.17    127538.0 0.68                           0.0   0 $
 GZV  SE E    0   1225 23.49    448179.0  0.6                           0.0   0 $
 GZV  SZ E    0   1225  9.53    271464.0 0.68                           375 125$
$ awk '{printf("%s \n", $0)}' inp.file | cat -A
  $
 2012 0811 1223 15.2 L  38.393  46.806  9.0  Teh 78 0.5 6.5LTeh                1  $
 GAP=74                                                                        E  $
 Iranian Seismological Center, Institute of Geophysics, University of Tehran   6  $
 STAT SP IPHASW D HRMM SECON CODA AMPLIT PERI AZIMU VELO SNR AR TRES  W DIS CAZ7  $
 MHD  SN E    0   1225 41.58    278118.0  0.8                           0.0   0  $
 VIS  SE E    0   1225 35.81    916098.0 1.28                           429 179  $
 KFM  BZ E    0   1226 23.74       -99.0 3.64                           548 170  $
 GLO  SZ E    0   1226 18.91     92061.7  0.8                           656 107  $
 RAZ  SN E    0   1225 34.17    127538.0 0.68                           0.0   0  $
 GZV  SE E    0   1225 23.49    448179.0  0.6                           0.0   0  $
 GZV  SZ E    0   1225  9.53    271464.0 0.68                           375 125 $

option -A from command cat, show end line and no printable characters...
Regards

Theres no reason your awk script

awk '{print $0," "}' in > out

should not work. I see that your lines are 80 char long. Is it possible there's line wrapping occurring in your terminal/editor?

Yes you right, i tested it on a Mint Linux and it works!
Thank you guys.