Taylor Lewick wrote: > > Hi, > I have the following one liner which works great in a shell script. > I have a comma delimited text file with the same number of rows. > I want to add the date in YYYY-MM-DD format to every line... > > I was doing this.. > cat $file | awk '{print $0 "," "'$fdate'"}' >>$new_file
Useless use of cat: awk '{print $0 "," "'$fdate'"}' $file >>$new_file Or if you want to do it in perl: perl -MPOSIX -nle'print$_.strftime",%Y-%m-%d",localtime' $file >>$new_file John -- use Perl; program fulfillment -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]