Hi,
I have a file where data is pipe seperated. I want to extract a field which is 12 characters in length and starts with BBG(|BBG000KFWBB1|). Both has pipe delimeter at the start and end. The value can be anywhere in the file.
I want to extract this field that starts with BBG from the file(inputfile.out). File has 70k or more rows. My output should be BBG000KFWBB1.
If you look at your AWK man page or search for AWK tutorials online, you'll quickly find the answer to you $0 question.
/ is a regular expression delimiter and \ is used to escape the character that follows it. If you are not familiar with regular expressions, you need to set aside some time for study.