Hi
I have approximately 62000 files. My program stops after only processing 285 files. The error message is "too many files open".
Question?
Is not enough the command close (cmd) to close the previous file???
BEGIN{FS=";"
while ((getline < "List_files_Feb.txt") > 0){
j++
files[j]=$1
fe[j]=sprintf("%0+2s",$3)
}
close("List_files_Feb.txt")
for ( j=1; j in files ; j++ )
{
r = ini""files[j]
print r" - "j
if ( r ~ /.Z$/ ){
cmd = "zcat " r
}
else{
cmd ="cat " r}
while( cmd | getline var ) {
print var >> fin"T33.a"substr(var,111,6)".a"fe[j]
}
close (cmd)
}
}'
Thanks malpa
I have approximately 62000 files. My program stops after only processing 285 files. The error message is "too many files open".
Question?
Is not enough the command close (cmd) to close the previous file???
BEGIN{FS=";"
while ((getline < "List_files_Feb.txt") > 0){
j++
files[j]=$1
fe[j]=sprintf("%0+2s",$3)
}
close("List_files_Feb.txt")
for ( j=1; j in files ; j++ )
{
r = ini""files[j]
print r" - "j
if ( r ~ /.Z$/ ){
cmd = "zcat " r
}
else{
cmd ="cat " r}
while( cmd | getline var ) {
print var >> fin"T33.a"substr(var,111,6)".a"fe[j]
}
close (cmd)
}
}'
Thanks malpa