manipulate data with specific format


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting manipulate data with specific format
# 1  
Old 04-25-2008
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
tonet
# 2  
Old 04-25-2008
Code:
awk '$2=$2*1000' data.file

# 3  
Old 04-25-2008
Code:
awk '{$2=sprintf("%0.f"), $2*1000}1' file

Regards
# 4  
Old 04-25-2008
thanks a lot Smilie
tonet
# 5  
Old 04-25-2008
About the same file how could print it in inverse order?.
thanks a lot again . Smilie
tonet
# 6  
Old 04-25-2008
With sort, read the man page.

Regards
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Help - manipulate data by columns and repeated

Hello good afternoon to everyone. I'm new to the forum and would like to request your help in handling data. I hope my English is clear. I have a file (Dato01.txt) to contine the following structure. # Col1 - Col2 - Col3 - Col4 Patricia started Jun 22 05:22:58 Carolina started Jun... (5 Replies)
Discussion started by: kelevra
5 Replies

2. Shell Programming and Scripting

Converting text files to xls through awk script for specific data format

Dear Friends, I am in urgent need for awk/sed/sh script for converting a specific data format (.txt) to .xls. The input is as follows: >gi|1234|ref| Query = 1 - 65, Target = 1677 - 1733 Score = 8.38, E = 0.6529, P = 0.0001513, GC = 46 fd sdfsdfsdfsdf fsdfdsfdfdfdfdfdf... (6 Replies)
Discussion started by: Amit1
6 Replies

3. Shell Programming and Scripting

Need help to manipulate data using script

Hi i want to manipulate my data to convert row to column name 600 Slno vlan 1 600 2 609 3 700 name 700 Slno vlan 1 600 2 609 3 700 (8 Replies)
Discussion started by: nith_anandan
8 Replies

4. AIX

How to manipulate date format?

Hi, I need to convert the below string in 'yyyymmdd' format. e.g., 24 June 2011 -> 20110624 Please help !! (4 Replies)
Discussion started by: ruby
4 Replies

5. Shell Programming and Scripting

Using Awk for extracting data in specific format

please help me writing a awk script 001_r.pdb 0.0265185 001_r.pdb 0.0437049 001_r.pdb 0.0240642 001_r.pdb 0.0310264 001_r.pdb 0.0200482 001_r.pdb 0.0146746 001_r.pdb 0.0351344 001_r.pdb 0.0347856 001_r.pdb 0.036119 001_r.pdb 1.49 002_r.pdb 0.0281011 002_r.pdb 0.0319908 002_r.pdb... (5 Replies)
Discussion started by: phoenix_nebula
5 Replies

6. Shell Programming and Scripting

how to manipulate with lines while playing with data

hello everyone, well I have a file which contains data, I want to add the data on hourly basis, like my file contains data for 24 hours, (so a total of 1440 ) lines. Now i want to add the data on hourly basis to get average values. like if I use (head) command it is ok for first go, but... (5 Replies)
Discussion started by: jojo123
5 Replies

7. Shell Programming and Scripting

manipulate & format the output of spool command

Hi All, I am spooling the data some sql queries into a single file but wanted to know how to format the data of the file generated by spool. #!/bin/sh unset -f USAGE USAGE () { clear echo "############################USAGE#######################\n" echo "Incorrect number of... (2 Replies)
Discussion started by: ss_ss
2 Replies

8. UNIX for Dummies Questions & Answers

Excel data manipulate

All, I have the following format of data in a spreadsheet A 1 2 3 4 B 1 2 3 4 where 'A' is value of 'A1', '1 2 3 4' is value of cell B1, 'B' is value of cell A2, and '1 2 3 4' is value of cell B2. There... (12 Replies)
Discussion started by: rahulrathod
12 Replies

9. Shell Programming and Scripting

extract specific data from xml format file.

Hi, I need to extract the start time value (bold, red font) under the '<LogEvent ID="Timer Start">' tag (black bold) from a file with the following pattern. There are other LogEventIDs listed in the file as well, making it harder for me to extract out the specific start time that I need. . .... (7 Replies)
Discussion started by: 60doses
7 Replies

10. UNIX for Dummies Questions & Answers

To manipulate a specific line

Hi, I would like to cut a specific line from a text file and then manipulate the text in that line. For eg. below is "tmp" file. ----------------- Tue 07/05/05 00:27:34.333 Tue 07/05/05 00:27:34.333 4 events were processed for customer 315 and will be correctly resolved when 315MERGE is run:... (2 Replies)
Discussion started by: dhiman.sarkar
2 Replies
Login or Register to Ask a Question