How do I write a script to terminate in 10 hours if a file is not found.
The script has to check for a file, if file not found go to sleep for 1 hour, check again....sleep....
If file not found even after 12 hours, then exit with error
thanks for your help
fold does not work as the record may be a variable lenght.
What I am trying to do is insert a newline before 'UNH'
This substitution works
sed 's/UNH/*!!@UNH/' contrl0.txt
What I want to do is
sed 's/UNH/geta newline char hereUNH/' contrl0.txt
I tried
sed 's/UNH/\\nUNH/' contrl0.txt and a few...
Nope, Can not get to either. I think I am hitting the awk's limits that are RECORD-based.If I reduce the amount of text then it works fine. Any ideas of how I can workaround this limit?
It does not come back with anything:
$ awk -f a5.awk contrl0.txt
+ awk -f a5.awk contrl0.txt
$
a5.awk is:
$ cat a5.awk
+ cat a5.awk
BEGIN {
RE="UNH.*"
RS=FS="UNT"
}
{
for(i=1;i<= NF;i++)
if (match($i, RE))
printf...
No its not Oracle related.
I am executing:
awk -f a4.awk contrl0.txt
a4.awk is:
BEGIN {
RE="UNH.*"
FS="UNT"
}
{
for(i=1; i <= NF; i++) {
if (match($i, RE))
print substr($i, RSTART) FS ;
}...
I am calling a sqlplus script from a shell script. I get an error on the size of the string I am passing as a parameter. Can someone help me on how I can solve this.
Error is:
string beginning "UNH+000000..." is too long. maximum size is 239 characters.
Line that gives error...
I get error
$ new1
new1: syntax error at line 5 : `done' unexpected
File new1 is:
#!/bin/ksh
nawk -f zen.awk zen.txt | while read theLine do
echo "here is my line to process->[${theLine}]"
done
file zen.awk is:
BEGIN {
RE="UNH.*"
FS="UNT"
}
{...
What I need to do is take each line and further process it.
Is it possible to assign print substr($i, RSTART) FS to a variable and then do the futher processing to this variable using a unix script?
How do I write the print output to a file?
I tried print substr($i, RSTART, RLENGTH+100) >> aaa.txt
but I get an error:
syntax error The source line is 9.
The error context is
print substr($i, RSTART, RLENGTH+100) >>
awk: The statement cannot be...
It only returns a part of the string.
The result should have been
UNH+00000000012689+BTS:D:96A:UN'BGM+XZ8+1'DTM+137:20030718:102'LIN+1'RFF+XC3:F2003-07-18-06.00.47.168473'RFF+AEK:03071806000002'RFF+CR:EXM 1000735AT1ZD'SE
Q++1'GIS+1'UNT
but what I get is...
This is my data file:
UNA:+.? 'UNB+UNOA:3+CHASE:ZZ+ADSD:ZZ+030718:0103+00000000000630'UNH+0000
0000000326+CRL:2:2:UN'UCI+47000618072003+EV1:ZZ+CH:ZZ+7'UNT+3+000
00000000326'UNZ+1+00000000000630'
UNA:+...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.