Citaat:
Beste Amruta Pitkar,
De code
awk '$ 4 ~ /^+/{ sub (/ ^ \ +0 +/,"",$ 4)) (print $ 0)' MyFile.txt
werkt fine.there is geen probleem met deze code ...
Ik denk dat je r doet enkele fout door uw eigen.
controleer uw input bestand.
anders kopieer deze voor uw invoerbestand
Uw factuur van +00002780.96 voor A / C niet. 25287324 is verschuldigd op 11.06.
Uw factuur van +00422270.48 voor A / C niet. 28931373 is verschuldigd op 11.06.
opslaan en het uitvoeren ... dit werkt prima ...
Groeten,
Pankaj
|
Op mijn AIX vak, het commando awk werkt niet.
Binnen het patroon, + moet worden vervangen door \ +.
Code:
$ cat MyFile.txt
Your bill of +00002780.96 for a/c no. 25287324 is due on 11-06.
Your bill of +00422270.48 for a/c no. 28931373 is due on 11-06.
$ awk '$4 ~ /^+/{ sub(/^\+0+/,"",$4) }{print $0}' MyFile.txt
awk: 0602-521 There is a regular expression error.
*?+ not preceded by valid expression
The source line number is 1.
The error context is
$4 ~ >>> /^+/ <<< { sub(/^\+0+/,"",$4) }{print $0}
$ awk '$4 ~ /^\+/{ sub(/^\+0+/,"",$4) }{print $0}' MyFile.txt
Your bill of 2780.96 for a/c no. 25287324 is due on 11-06.
Your bill of 422270.48 for a/c no. 28931373 is due on 11-06.
$