First Thanks for your help.
I have a problem with my script in AIX, In LINUX I have not problem.
awk -f extraetulua.awk file.txt
file.txt contain null characters like this ^@, ^O,. The file contain a line of 2097152 characters.
Script print in another file all the characters except the null characters. When the script find a ^O, print 9 or when the script find ^@ it doesn´t print.
First problem. In AIX, I can not find the way to write in a script the null character ^@. In linux Ctrl v + Ctrl j = ^@
Second problem. the script doesn´t run in AIX, and it show me a problem with v="*". I have changed the var v some times change it for \*, /*/, "*", "'*'", but the same, it show me that there is a problem whit a var v="*"
awk: 0602-502 The statement cannot be correctly parsed. The source line is 12.
awk: 0602-521 There is a regular expression error.
?*+ not preceded by valid expression.
My script: extraetulua.awk
{
i=1
x="[0-9]"
y="[a-z]"
z=" "
w="*"
v="^O"
while (i <= 2097152){
if ( substr($0,i,1) ~ x || substr($0,i,1) ~ y || substr($0,i,1) ~ z || substr($0,i,1) ~ w }
{
printf "%s",substr($0,i,1) > "tmp"
)
if (substr($0,i,1) ~ v)
{
printf "%s",9 > "tmp"
}
ì++
}
}
malpa
Thanks for your Help again
I have a problem with my script in AIX, In LINUX I have not problem.
awk -f extraetulua.awk file.txt
file.txt contain null characters like this ^@, ^O,. The file contain a line of 2097152 characters.
Script print in another file all the characters except the null characters. When the script find a ^O, print 9 or when the script find ^@ it doesn´t print.
First problem. In AIX, I can not find the way to write in a script the null character ^@. In linux Ctrl v + Ctrl j = ^@
Second problem. the script doesn´t run in AIX, and it show me a problem with v="*". I have changed the var v some times change it for \*, /*/, "*", "'*'", but the same, it show me that there is a problem whit a var v="*"
awk: 0602-502 The statement cannot be correctly parsed. The source line is 12.
awk: 0602-521 There is a regular expression error.
?*+ not preceded by valid expression.
My script: extraetulua.awk
{
i=1
x="[0-9]"
y="[a-z]"
z=" "
w="*"
v="^O"
while (i <= 2097152){
if ( substr($0,i,1) ~ x || substr($0,i,1) ~ y || substr($0,i,1) ~ z || substr($0,i,1) ~ w }
{
printf "%s",substr($0,i,1) > "tmp"
)
if (substr($0,i,1) ~ v)
{
printf "%s",9 > "tmp"
}
ì++
}
}
malpa
Thanks for your Help again