dickiebird
Programmer
Guys....
Already posted on Unix scripting - to no avail.
I have an awk solution (has to be awk on aix3.2.5 - no nawk/gawk on this old box)which occasionally fails when the text is > 3000 bytes.(Awk limitation circa 1963 ???)
Could someone show the sed to do the same job for me ?
awk -v GBPT="$GBP" -v NEWT="$NEW" '
BEGIN {
RS="^C"
FS="^C"
ORS="\n"
OFS="\n"
}
{
if (index($0,"Sterling")
print $0 >> GBPT
else
print $0 >> NEWT
}' ${IN_FILE}
TIA
;-) Dickie Bird
db@dickiebird.freeserve.co.uk
Already posted on Unix scripting - to no avail.
I have an awk solution (has to be awk on aix3.2.5 - no nawk/gawk on this old box)which occasionally fails when the text is > 3000 bytes.(Awk limitation circa 1963 ???)
Could someone show the sed to do the same job for me ?
awk -v GBPT="$GBP" -v NEWT="$NEW" '
BEGIN {
RS="^C"
FS="^C"
ORS="\n"
OFS="\n"
}
{
if (index($0,"Sterling")
print $0 >> GBPT
else
print $0 >> NEWT
}' ${IN_FILE}
TIA
;-) Dickie Bird
db@dickiebird.freeserve.co.uk