The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

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 and shell scripting languages 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 05:53 PM
Report running processes in a specific format (tricky column filtering) goldfish Shell Programming and Scripting 6 02-14-2008 08:22 PM
extract specific data from xml format file. 60doses Shell Programming and Scripting 7 01-16-2008 03:26 AM
To manipulate a specific line dhiman.sarkar UNIX for Dummies Questions & Answers 2 07-10-2005 04:57 AM
Moving specific data between databases lloydnwo UNIX for Advanced & Expert Users 2 10-01-2004 08:09 AM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 04-25-2008
tonet
Guest
  
 

Posts: n/a
Bits: 0 [Banking]
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
  #2 (permalink)  
Old 04-25-2008
danmero danmero is offline Forum Advisor  
  
 

Join Date: Nov 2007
Location: 45.48-73.63
Posts: 1,419
Code:
awk '$2=$2*1000' data.file
  #3 (permalink)  
Old 04-25-2008
Franklin52 Franklin52 is offline Forum Staff  
Moderator
  
 

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

Posts: n/a
Bits: 0 [Banking]
thanks a lot
  #5 (permalink)  
Old 04-25-2008
tonet
Guest
  
 

Posts: n/a
Bits: 0 [Banking]
About the same file how could print it in inverse order?.
thanks a lot again .
  #6 (permalink)  
Old 04-25-2008
Franklin52 Franklin52 is offline Forum Staff  
Moderator
  
 

Join Date: Feb 2007
Posts: 4,293
With sort, read the man page.

Regards
Sponsored Links
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 03:35 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0