Dec 3, 2002 #1 rufflocks Technical User Jun 29, 2001 26 US I want to use awk to insert system date in a pipe-delimited file, so the output looks like: firstname|lastname|20021203|address The other fields of records in the file is created by the same awk script. Thanks for any ideas?
I want to use awk to insert system date in a pipe-delimited file, so the output looks like: firstname|lastname|20021203|address The other fields of records in the file is created by the same awk script. Thanks for any ideas?
Dec 3, 2002 1 #2 vgersh99 Programmer Jul 27, 2000 2,146 US BEGIN { FS=OFS="|" insertField="3" dateCMD="date '+%Y%m%d'" } { dateCMD | getline dateNow close(dateCMD); $3=dateNow OFS $3 print } vlad +----------------------------+ | #include<disclaimer.h> | +----------------------------+ Upvote 0 Downvote
BEGIN { FS=OFS="|" insertField="3" dateCMD="date '+%Y%m%d'" } { dateCMD | getline dateNow close(dateCMD); $3=dateNow OFS $3 print } vlad +----------------------------+ | #include<disclaimer.h> | +----------------------------+
Dec 3, 2002 Thread starter #3 rufflocks Technical User Jun 29, 2001 26 US Thanks. It seems to work. Upvote 0 Downvote