![]() |
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 |
| Format output using awk in script. | bperl | Shell Programming and Scripting | 8 | 01-14-2008 01:09 AM |
| Q: Recording shell script screen output using "script" command ? | lalfonso.gomez | Shell Programming and Scripting | 4 | 01-18-2007 09:31 PM |
| log script input and output using tee ? | moseschrist | Shell Programming and Scripting | 0 | 11-12-2006 03:32 AM |
| File name of a script output | cheo_pr | Shell Programming and Scripting | 3 | 09-01-2005 04:40 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
Please i need your help.
i made this script with awk, this scripts count and list a pattern for each directory in the output as shown. but not as desired. i want the output will be listed in a tabular way, using awk: cuenta_cdrs() { for dir in * do cd $dir for file in * do if [ -f $file ] then cat listacdrs|awk ' BEGIN {print "dia", "\t", "Cantidad"} $1 == prev {totaldia+=1} $1 != prev {print prev,totaldia;totaldia=1;prev=$1;filas=filas+1}' fi done cd .. done } OUTPUT dia Cantidad 01/09/2006 1275 02/08/2006 1285 03/08/2006 1310 04/08/2006 1300 05/08/2006 1415 dia Cantidad 01/09/2006 1275 02/08/2006 1285 03/08/2006 1310 04/08/2006 1300 05/08/2006 1415 06/08/2006 1265 dia Cantidad 01/09/2006 1275 02/08/2006 1285 But i want the output to be this way: OUTPUT DESIRED dia Cantidad dia cantidad 01/09/2006 1275 01/09/2006 1275 02/08/2006 1285 02/08/2006 1285 03/08/2006 1310 03/08/2006 1310 04/08/2006 1300 04/08/2006 1300 05/08/2006 1415 05/08/2006 1415 Thanks |
|
||||
|
Quote:
01/10/2006 08:20 CF004 01/10/2006 08:25 CF006 .. 04/10/2006 04:23 CF1020 --- DD/MM/YYY HH:MM CONCSECUTIVE NUMBER. This purpose is count and list the number of consecutives per day usin awk, the results are ok with this script but i need to b elisted or output in a tabaular way for each directory but not be listea by pages. I apprecitae your help please. |
| Sponsored Links | ||
|
|
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|