dimanche 2 juillet 2017

Escaping parenthesis in gawk in windows

I am facing a rather strange issue when trying to escape a parenthesis in awk. My file has the following line

79-Au-196 isomer state population  0.153658     mb (m1 E= 0.5957MeV Jp=-12.0)

So I want to extract column 5 (i.e. 0.153658). To do that I am running the following

>gawk "/79-Au-196 isomer state population/{if($7=="\(m1")print $5}" Au_test.out

and what I get is

> gawk: /79-Au-196 isomer state population/{if($7==\(m1)print $5} gawk: 
>                                                  ^ backslash not last character on line

I tried replacing "\(m2" with "%s(m2" or '\(m2' but nothing actually worked.

Any idea on how to make it work?

Aucun commentaire:

Enregistrer un commentaire