awk and sed both invented in UNIX.
At the highest level of description,
awk is a tokenize.
sed is an automated editor (stream editor).
Examples:
Code:
awk '{ print $2 }' "51 52 53"
Prints "52" - extract the second token/field.
sed 's/52/XX/' "51 52 53"
Prints "51 XX 53" - substitutes (s) 52 with XX
In windows, I use biterscripting to do similar things. related examples.
wex "2" "51 52 53"
Prints "52" - extract the second token/field. wex = word extractor
sal "^52^" "XX" "51 52 53"
Prints "51 XX 53" - substitutes (s) 52 with XX. sal = string alerter
Bookmarks