You're replying to a comment by amr attia.

amr attia Permalink
November 25, 2015, 11:52

I have file with | separator and I need to print first field $1 and other fields need to print part which match the regular expression \[(.*?)\>\
i thin code will be like that

cat x.txt |nawk -F"|" '{print $1"|"match regex $2,"|" match regex $3}'

sample of file

123|aaa[AAA]78->dfd|100
124|bbb[BBB]78->dfd|100
125|ccc[CCC]78->dfd|100
126|ddd[DDD]78->dfd|100
127|eee[EEE]78->dfd|100
128|fff[FFF]78->dfd|100

output
123|[AAA]78|100
124|[BBB]78|100

any on can help please

Reply To This Comment

(why do I need your e-mail?)

(Your twitter handle, if you have one.)

Type the word "quake3_122": (just to make sure you're a human)

Please preview the comment before submitting to make sure it's OK.