![]() |
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 |
| Output format - comparison with I/p file | velappangs | Shell Programming and Scripting | 1 | 04-03-2008 06:31 AM |
| File Format issue: Output of sqlplus | deepakgang | UNIX for Dummies Questions & Answers | 2 | 10-25-2007 03:56 AM |
| [need help] output format from awk | bucci | Shell Programming and Scripting | 6 | 02-09-2007 04:41 AM |
| Output in a particular format using AWK | Raynon | Shell Programming and Scripting | 4 | 01-24-2007 04:07 AM |
| ls output format | tonyt | UNIX for Dummies Questions & Answers | 6 | 11-23-2001 11:31 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
Format the output of file
hello all
Script and example of file #!/bin/sh #sh gdata.sh /users/testsuite/db/appl/ DATE=`date '+20%y-%m-%d'` echo $DATE for i in ${1}/$DATE/* ; do find $i -name daily -prune -o -name run.log -print -exec grep -c ! {} \; done > test.log. The test.log contains output like this /users/testsuite/db/appl/2006-01-24/Devel/Sun/run.log 19 /users/testsuite/db/appl/2006-01-24/Devel/Linus/run.log 20 /users/testsuite/db/appl/2006-01-24/9/Sun/run.log 10 /users/testsuite/db/appl/2006-01-24/8/Sun/run.log 19 But i want to cut and format my file like this Date : 2006-01-24 Version Host Fails Devel Sun 19 Devel Linu 20 9 Sun 10 8 Sun 19 Please help me to modify this script . I have to show this staticts on web . Thanks a lot |
|
||||
|
can you copy and post what you have typed here....
space is a valid delimiter and cut can't say it as invalid delimiter... it should work... however try this... cat test.log | paste - - | nawk 'BEGIN { FS="[/ ]" } { print $7,$8,$10 }' |
|
||||
|
sorry i didnt put space that's why it was giving me error
the first command is working.. but i am not getting number of failes .. because it is in second line .. i am getting colunm 7 and 8 .. can you tell me how to join the 2 lines.. i think i have to join first lines and then cut the data from file .. pls write back and thanks for helping me |
| Sponsored Links | ||
|
|
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|