The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
Google UNIX.COM


Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
sed or other tool to manipulate data, including email addresses manouche Shell Programming and Scripting 3 02-19-2008 02:53 PM
Report running processes in a specific format (tricky column filtering) goldfish Shell Programming and Scripting 6 02-14-2008 05:22 PM
extract specific data from xml format file. 60doses Shell Programming and Scripting 7 01-16-2008 12:26 AM
To manipulate a specific line dhiman.sarkar UNIX for Dummies Questions & Answers 2 07-10-2005 01:57 AM
Moving specific data between databases lloydnwo UNIX for Advanced & Expert Users 2 10-01-2004 05:09 AM

Reply
 
Submit Tools LinkBack Thread Tools Search this Thread Display Modes
  #1  
Old 04-25-2008
tonet
Guest
 

Posts: n/a
manipulate data with specific format

Hi everybody:

I have a problem with how I have to manipulate the data which have specific format like this:
Code:
249.      0.30727021E+05    0.30601627E+05    0.37470780E-01   -0.44745335E+02    0.82674536E+03
248.      0.30428182E+05    0.30302787E+05    0.40564921E-01   -0.45210293E+02    0.81456091E+03
247.      0.30129340E+05    0.30003945E+05    0.43904275E-01   -0.45641884E+02    0.80265021E+03
246.      0.29830500E+05    0.29705105E+05    0.47968332E-01   -0.45883633E+02    0.79155701E+03
245.      0.29531656E+05    0.29406262E+05    0.52036867E-01   -0.46166348E+02    0.78046381E+03
I would like to manipulate the data from second column, and for example if I do:

$2*1000
Actually I do not want the scientfic format
I have not output. So then somebody could give an idea?.
Thanks in advance
Reply With Quote
Forum Sponsor
  #2  
Old 04-25-2008
 

Join Date: Nov 2007
Location: 45.48-73.63
Posts: 736
Code:
awk '$2=$2*1000' data.file
Reply With Quote
  #3  
Old 04-25-2008
Moderator
 

Join Date: Feb 2007
Posts: 2,314
Code:
awk '{$2=sprintf("%0.f"), $2*1000}1' file
Regards
Reply With Quote
  #4  
Old 04-25-2008
tonet
Guest
 

Posts: n/a
thanks a lot
Reply With Quote
  #5  
Old 04-25-2008
tonet
Guest
 

Posts: n/a
About the same file how could print it in inverse order?.
thanks a lot again .
Reply With Quote
  #6  
Old 04-25-2008
Moderator
 

Join Date: Feb 2007
Posts: 2,314
With sort, read the man page.

Regards
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes




All times are GMT -7. The time now is 12:17 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0