![]() |
|
|
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 |
| Changing one column of delimited file column to fixed width column | manneni prakash | Shell Programming and Scripting | 5 | 06-22-2009 06:27 AM |
| Adding a column to a text based on file name | rlapate | Shell Programming and Scripting | 12 | 05-23-2009 10:22 PM |
| Adding a new column in a text file | snahata | Shell Programming and Scripting | 10 | 03-13-2009 07:00 AM |
| FILE:Adding new column | sandeep_hi | Shell Programming and Scripting | 2 | 06-09-2006 10:46 AM |
| Changing the column for a row in a text file and adding another row | aYankeeFan | Shell Programming and Scripting | 9 | 05-02-2005 10:42 PM |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
awk-adding a column to a file
Hello Friends, i used awk to sum up total size of files under a directory (with the help of examples, threads here). Code:
ls -l | awk '/^-/ {total += $5} END {printf "%15.0f\n",total}' >> total.txt
After each execution of the script total result is appended into a text file: Code:
7010 7794 8890 i would like to add the execution date of the script into first column and then the results to the second column, but i couldnt do it after some tries. Do you know how to modify the script to add the date (date format is not important)? expected: Code:
Aug 27 7010 Sep 27 7794 Oct 27 8890 thanks by advance |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|