I'm grepping for a bunch of files, and appending that into a file.
ll |grep WCZI786A > /home/jma1/WCZI
The files obviously return
-rw-rw-rw- 1 lowes lowes 2250 Aug 11 02:07 WCZI786A.030811020716.Z
-rw-rw-rw- 1 lowes lowes 8020 Aug 11 02:19 WCZI786A.030811021917.Z
-rw-rw-rw- 1 lowes lowes 9823 Aug 11 03:00 WCZI786A.030811030014.Z
The problem is, I only want to display the filesize, date, time and file name with my script.
Here is my script
awk -F, 'BEGIN { print "DATE TIME SIZE FILE"
print "---- ---- ---- ----"}
{ printf "%-13s %-10s %-12s %-8s\n", $5, $6, $7, $8, }' /home/jma1/WCZI
And here is the error I am getting
syntax error The source line is 3.
The error context is
{ printf "%-13s %-10s %-12s %-8s\n", $5, $6, $7, $8, >>> } <<<
awk: The statement cannot be correctly parsed.
The source line is 3.
So my question is, Is there a way to only take out the end information using printf, or do I have to display the entire thing.
Thanks for the help
Jason
ll |grep WCZI786A > /home/jma1/WCZI
The files obviously return
-rw-rw-rw- 1 lowes lowes 2250 Aug 11 02:07 WCZI786A.030811020716.Z
-rw-rw-rw- 1 lowes lowes 8020 Aug 11 02:19 WCZI786A.030811021917.Z
-rw-rw-rw- 1 lowes lowes 9823 Aug 11 03:00 WCZI786A.030811030014.Z
The problem is, I only want to display the filesize, date, time and file name with my script.
Here is my script
awk -F, 'BEGIN { print "DATE TIME SIZE FILE"
print "---- ---- ---- ----"}
{ printf "%-13s %-10s %-12s %-8s\n", $5, $6, $7, $8, }' /home/jma1/WCZI
And here is the error I am getting
syntax error The source line is 3.
The error context is
{ printf "%-13s %-10s %-12s %-8s\n", $5, $6, $7, $8, >>> } <<<
awk: The statement cannot be correctly parsed.
The source line is 3.
So my question is, Is there a way to only take out the end information using printf, or do I have to display the entire thing.
Thanks for the help
Jason