[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
AWK problem finding backslash
From: |
Joe Kolman |
Subject: |
AWK problem finding backslash |
Date: |
Fri, 8 Apr 2005 17:37:12 -0400 |
See code below:
BEGIN {FS="|"}
{
len10 = length(substr($10,1))
len11 = length(substr($11,1))
old_value = substr($10,1)
new_value = substr($11,1)
# octal 134 for \ hex 5c for \
# apparently cannot see \ !!!!
# neither sub nor gsub finds \ as hex code
# neither sub nor gsub finds \ as octal
# netiher sub nor gsub finds \ as \\
if (len10 >= 41) {sub("\\","",old_value); printf("\nentered len10")}
if (len11 >= 41) {sub("\\","",new_value); printf("\nentered len11")}
nlen10 = length(old_value)
nlen11 = length(new_value)
#printf("%s|%s|%s|%s|%s|%s|%s|%s|%s|%s|%s|\n", substr($1,1),
substr($2,1), subst
r($3,1),
# substr($4,1),
substr($5,1), substr
($6,1),
# substr($7,1),
substr($8,1), substr
($9,1),
# old_value, new_value)
printf ("\n len10 %d len11 %d nlen10 %d nlen11 %d", len10,len11, nlen10,
nlen11)
printf("\nsub10 %s\nnew10 %s\nsub11 %s \nnew11 %s", substr($10,1),
old_value,
substr($11,1), new_value)
}
~
~
~
- AWK problem finding backslash,
Joe Kolman <=