Difference between revisions of "AWK"
Jump to navigation
Jump to search
Michael.mast (talk | contribs) (Created page with " awk '{print $0}'") |
Michael.mast (talk | contribs) |
||
(One intermediate revision by the same user not shown) | |||
Line 1: | Line 1: | ||
+ | <ref>http://www.thegeekstuff.com/2010/01/8-powerful-awk-built-in-variables-fs-ofs-rs-ors-nr-nf-filename-fnr/?ref=binfind.com/web</ref> | ||
+ | ==General Notes== | ||
awk '{print $0}' | awk '{print $0}' | ||
+ | ==To use brackets as a seperator== | ||
+ | <ref>http://bytefreaks.net/gnulinux/bash/linux-bash-get-text-between-brackets</ref><br> | ||
+ | <pre> | ||
+ | echo "D:AI(A;OICI;GRGX;;;S-1-5-21-XXXXX0)(A;OICIID;0x1200a9;;;AU)(A;OICIID;FA;;;SY)(A;OICIID;FA;;;BA)(A;OICIID;FA;;;S-1-5-21-XXXXX1)" | awk 'NR {print $1}' RS='(' FS=')' | ||
+ | D:AI | ||
+ | A;OICI;GRGX;;;S-1-5-21-XXXXX0 | ||
+ | A;OICIID;0x1200a9;;;AU | ||
+ | A;OICIID;FA;;;SY | ||
+ | A;OICIID;FA;;;BA | ||
+ | A;OICIID;FA;;;S-1-5-21-XXXXX1 | ||
+ | </pre> |
Latest revision as of 13:37, 4 October 2017
General Notes
awk '{print $0}'
To use brackets as a seperator
echo "D:AI(A;OICI;GRGX;;;S-1-5-21-XXXXX0)(A;OICIID;0x1200a9;;;AU)(A;OICIID;FA;;;SY)(A;OICIID;FA;;;BA)(A;OICIID;FA;;;S-1-5-21-XXXXX1)" | awk 'NR {print $1}' RS='(' FS=')' D:AI A;OICI;GRGX;;;S-1-5-21-XXXXX0 A;OICIID;0x1200a9;;;AU A;OICIID;FA;;;SY A;OICIID;FA;;;BA A;OICIID;FA;;;S-1-5-21-XXXXX1