![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| 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 |
| perl script to print to values in rows and columns | nogu0001 | Shell Programming and Scripting | 3 | 02-22-2009 04:30 PM |
| awk - reformating rows into columns | jmd2004 | Shell Programming and Scripting | 1 | 08-13-2008 11:56 PM |
| How to changes rows to columns in a file | oracle123 | Shell Programming and Scripting | 4 | 07-31-2008 04:38 AM |
| compare columns from seven files and print the output | smriti_shridhar | Shell Programming and Scripting | 7 | 06-11-2008 12:22 AM |
| Columns to rows | mgirinath | Shell Programming and Scripting | 16 | 11-29-2007 07:03 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
want to print output if u have rows and columns
U have a file
File 1 0.3 0.2 0.4 0.3 0.8 0.11 0.22 0.4 0.23 0.45 0.56 0.78 0.98 0.11 0.32 0.2 0.4 0.45 0.54 0.2 0.33 0.44 0.21 0.22 0.98 0.8 0.2 0.34 0.54 0.98 0.12 0.1 0.22 0.32 0.34 0.89 0.22 File 2 rows columns 3 1 2 3 4 2 5 5 so from file 2 into file 1 output will be 0.11 0.45 0.2 0.89 I have used using awk awk -v num=3 '{if(NR==num) print($0);}' File1 | awk '{print $1}' awk -v num=2 '{if(NR==num) print($0);}' File1 | awk '{print $3} Now problem is it is long manual process as it is having big file So any done using perl or shell script..???? Last edited by cdfd123; 04-23-2009 at 12:50 AM.. Reason: check in file 1 |
|
||||
|
output in order wise
Dear Radulov,
actually overall output was right in using this awk command but in random order as u can see in output first one came as second order and second came as first as a large file is there it is confusing where it is ? But command wise is right Another latest reply is giving right answer in orderwise Thanks |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|