I did not see a mention of the systems being used as I scanned this thread. mhssatya and dsravan, please type the command:
uname -a
and paste the results in a post. This information may help our experts help you more effectively. Thanks.
I am sorry that I copied wrongly. The code is working now but IF i have 2 files namely CARE01_DLY_AUS_20060721 and CARE01_DLY_MKT_20060721
It's creating only 1 new file named CARE01_DLY_MKT_20060721 _new. But what happened to the other file namely CARE01_DLY_AUS_20060721 _new. It's writing only 1 file.
Once again I am sorry to copy it worngly. It happened because i copied wrongly.
The server is up and running. Here is the output. It still didn't create 2nd file.
+ dev=/biddf/ab6498/dev/ctl
+ cd /biddf/ab6498/dev/ctl
+ echo /biddf/ab6498/dev/ctl
/biddf/ab6498/dev/ctl
+ + date +%Y%m%d
files=CARE01_DLY_???_20060721
+ echo CARE01_DLY_AUS_20060721 CARE01_DLY_MKT_20060721
CARE01_DLY_AUS_20060721 CARE01_DLY_MKT_20060721
+ awk {data[FNR] = $0; out=FILENAME "_new"; file[FNR]=out;} END { if (
FNR - 2 == $1) { for ( i=2 ; i < NR; i++ ) { print data[i] > file[i]}
close(file[i])}else { print "error"} } CARE01_DLY_AUS_20060721
CARE01_DLY_MKT_20060721
awk: A print or getline function must have a file name.
The input line number is 5. The file is CARE01_DLY_MKT_20060721.
The source line number is 1.