Transforming data to other format


 
Thread Tools Search this Thread
Top Forums Programming Transforming data to other format
# 1  
Old 11-30-2012
Transforming data to other format

Dear All

I would like to transform data from one format to another format.

my Input:

Code:
0	0	1
0	1	0.308
0	2	0.554
0	3	0.287

output:

Code:
Z (0,0)= 1
Z (0,1)=0.308
Z (0,2)=0.554
Z (0,3)=0.287

Kindly advice how to do the same using awk command.

Many Thanks
Balaji

Last edited by jim mcnamara; 11-30-2012 at 02:58 PM..
# 2  
Old 11-30-2012
Code:
awk '{printf( "Z (%d,%d)=%f\n", $1, $2, $3}' infile > outfile

Try that.
# 3  
Old 11-30-2012
Hi

Thanks. It works.

Many Thanks
BalajiSmilie

Quote:
Originally Posted by jim mcnamara
Code:
awk '{printf( "Z (%d,%d)=%f\n", $1, $2, $3}' infile > outfile

Try that.
Login or Register to Ask a Question

Previous Thread | Next Thread

8 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Script to generate Excel file or to SQL output data to Excel format/tabular format

Hi , i am generating some data by firing sql query with connecting to the database by my solaris box. The below one should be the header line of my excel ,here its coming in separate row. TO_CHAR(C. CURR_EMP_NO ---------- --------------- LST_NM... (6 Replies)
Discussion started by: dani1234
6 Replies

2. UNIX for Dummies Questions & Answers

Transforming data so it looks like the one you specified

Lets say for instance I have this data within a file named transform xxx#yyy@zzz and I want it to be in the format ofZZZ xxx-yyy How do I go about doing this? (3 Replies)
Discussion started by: l3monz
3 Replies

3. Programming

Transforming 3 columns to matrix format

Dear All I have a huge data for 3 columns similar to this D2cls0 D2cls0 1 D2cls0 D2cls1 0.308 D2cls0 D2cls2 0.554 D2cls0 D2cls3 0.287 D2cls0 D2cls4 0.633 D2cls0 D2cls5 0.341 D2cls0 D2cls6 0.665 D2cls0 D2cls7 0.698 D2cls0 D2cls8 0.625 D2cls0 D2cls9 0.429 I... (9 Replies)
Discussion started by: bala06
9 Replies

4. UNIX for Advanced & Expert Users

Transforming psmf to ogv

Hi all. I would like to create a program that converts psmf file format (PSMF - MultimediaWiki) to ogv (Ogg - Wikipedia, the free encyclopedia). I know C++ and I worked with BMPs (so I can understand a simple file system like the BMP header is) but I didn't touch any kind of sound/video file... (1 Reply)
Discussion started by: lilezek
1 Replies

5. Shell Programming and Scripting

transforming records

Hi all In input file I have records like this: 0,1,0,87,0,0,"6,87","170,03",0,"43,5",0,0,0,0,"6,87","126,53" and in output file I need that these records transforms in : 0 1 0 87 0 0 6,87 170,03 0 43,5 0 0 0 0 6,87 126,53 Could you help me in this case? Please (13 Replies)
Discussion started by: shizik
13 Replies

6. UNIX for Dummies Questions & Answers

Help me to format this data please

Good day, I have a script on each machine on our network that will say the computer name and the number of updates needed. Then the script will send a file via scp to a network share with the title hostname.local The contents of the file would be: hostname N (with N being the number of... (11 Replies)
Discussion started by: glev2005
11 Replies

7. UNIX for Dummies Questions & Answers

converting a tabular format data to comma seperated data in KSH

Hi, Could anyone help me in changing a tabular format output to comma seperated file pls in K-sh. Its very urgent. E.g : username empid ------------------------ sri 123 to username,empid sri,123 Thanks, Hema:confused: (2 Replies)
Discussion started by: Hemamalini
2 Replies

8. Shell Programming and Scripting

Help Required In Transforming A File

How will i convert a file <LREC><L:EPOCH>1198331268.553</L:EPOCH><LDATE>10-12-07</LDATE><L:SERVER>NONE</L:SERVER><L:PORT>NONE</L:PORT><LTIME>13:47:48.553</LTIME><LTEXT>dnvdmxk</LTEXT></LREC>... (3 Replies)
Discussion started by: anju
3 Replies
Login or Register to Ask a Question