Hi,
program:
echo -n "Enter the file to process: "
read inputFile
date
nawk '
/^\[.*\]/ {
id=$3
f=id".txt" # assign f
sub(/{/,"",f) # replace { with nothing, in variable f
sub(/}/,"",f) # replace } with nothing, in variable f
time=$1" "$2 # timestamp is column 1 and 2
print>>f # use append command for writing line
close(f) # close the file
next
}
{
print time" "id" "$0>>f
close(f) # close file
}
' $inputFile
date # display time to see how long it took
Why oh why can i not get it to make the files in another directory (results for e.g.). I have tried every combo of quotes.
Please help,
S.
program:
echo -n "Enter the file to process: "
read inputFile
date
nawk '
/^\[.*\]/ {
id=$3
f=id".txt" # assign f
sub(/{/,"",f) # replace { with nothing, in variable f
sub(/}/,"",f) # replace } with nothing, in variable f
time=$1" "$2 # timestamp is column 1 and 2
print>>f # use append command for writing line
close(f) # close the file
next
}
{
print time" "id" "$0>>f
close(f) # close file
}
' $inputFile
date # display time to see how long it took
Why oh why can i not get it to make the files in another directory (results for e.g.). I have tried every combo of quotes.
Please help,
S.