Compact 3-D output from a big input like:


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Compact 3-D output from a big input like:
# 1  
Old 12-04-2008
MySQL Compact 3-D output from a big input like:

Hi Experts!!!!
Tried a lot but in vein,no success, please help to achieve this
LOGIC behind is first field is reffrance row field, the second field shoud be made titles of coulmn and the the third field is made as matrix value.
And if they dont match the matrix value should be 0. (Unix (Shell, perl, awk, sed, tr or one liner will do).

INPUT FILE:
1000K,MINE,345654
1000K,YOUR,909285
200K,MINE,886049
50K,MINE,277339
50K,YOUR,210002
100K,YOUR,995994
100K,MINE,999996
500K,HIS,656565
200K,HIS,45103
1000K,HER,323232

OUTPUT FILE:

K,MINE,YOUR,HIS,HER
1000K,345654,909285,0,323232
200K,886049,0,45103,0
50K,277339,210002,0,0
100K,999996,995994,0,0
500K,0,0,656565,0

Thanks A lot For interest and solution.Smilie


War doesnt determine who is right, it determines who is left.

Last edited by ashis.tewari; 12-09-2008 at 02:33 AM.. Reason: No ANswer
# 2  
Old 12-04-2008
exercise??

No home work on here!
Login or Register to Ask a Question

Previous Thread | Next Thread

7 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Compact script with array - Good idea?

Hi, I have a shell script where a lot of the code is repeated. I wanted to make the code much more compact so I spoke to a guy and he suggested using arrays, like follows: #!/bin/bash readonly -a nginx=('nginx' '--prefix=/opt' '-j 4' 'http://nginx.org/download/nginx-1.2.2.tar.gz' )... (2 Replies)
Discussion started by: Spadez
2 Replies

2. Shell Programming and Scripting

Show pages on a script's big output

Hi again: I have this code which gives an large output(several screens), and I want to display on screen at a time (like more does)....how can I do this? echo echo "Los roles en el sistema son:" echo lsrole -a dfltmsg ALL|sed 's/dfltmsg=/Descripcion=/' thanks Israel. (4 Replies)
Discussion started by: iga3725
4 Replies

3. Shell Programming and Scripting

Dynamic output file generation using a input text file with predefined output format

Hi, I have two files , one file with data file with attributes that need to be sent to another file to generate a predefined format. Example: File.txt AP|{SSHA}VEEg42CNCghUnGhCVg== APVG3|{SSHA}XK|"password" AP3|{SSHA}XK|"This is test" .... etc --------- test.sh has... (1 Reply)
Discussion started by: hudson03051nh
1 Replies

4. UNIX for Dummies Questions & Answers

How big is too big a config.log file?

I have a 5000 line config.log file with several "maybe" errors. Any reccomendations on finding solvable problems? (2 Replies)
Discussion started by: NeedLotsofHelp
2 Replies

5. Shell Programming and Scripting

Script to compact information !

Hello Group, Could you please help me with a shell script that condense in this case each 12 rows of hour information in only one row per day as following: Final Fields in each row 1.Ticker Name 2. D (Daily) 3. Date 4. Open Price (The open price of the first record of the day) 5. High... (13 Replies)
Discussion started by: csierra
13 Replies

6. UNIX for Dummies Questions & Answers

How to view a big file(143M big)

1 . Thanks everyone who read the post first. 2 . I have a log file which size is 143M , I can not use vi open it .I can not use xedit open it too. How to view it ? If I want to view 200-300 ,how can I implement it 3 . Thanks (3 Replies)
Discussion started by: chenhao_no1
3 Replies

7. Windows & DOS: Issues & Discussions

formatting a Compact Flash in DOS format

:confused: I tryied to use the mount Command (and the msdos.utils) in Darwin 1.4 (OS X) to format a Compact Flash in DOS Format (I had already this native format but I changed it with Disk Utility in MacOS standard and the PC Card slot of a Windows 98-Laptop can't nore read the card) I want to... (1 Reply)
Discussion started by: dreamsurfer
1 Replies
Login or Register to Ask a Question