I want to extract the first column between this two lines (%BLOCK positions_frac & %ENDBLOCK positions_frac) in "file1".
%BLOCK positions_frac
Si 0.5303000000000000 0.0000000000000000 0.3333000000000000
Si 0.0000000000000000 0.5303000000000000 0.6666299999999999
Si 0.4697000000000000 0.4697000000000000 0.9999700000000000
O 0.1462000000000000 0.4142000000000000 0.8810000000000000
O 0.7320000000000000 0.5858000000000000 0.7856700000000000
O 0.5858000000000000 0.7320000000000000 0.2143300000000000
O 0.2680000000000000 0.8538000000000000 0.5476700000000000
O 0.4142000000000000 0.1462000000000000 0.1190000000000000
O 0.8538000000000000 0.2680000000000000 0.4523300000000000
%ENDBLOCK positions_frac
I can get that using:
awk '/%BLOCK\ positions_frac/{flag=1;next}/%ENDBLOCK\ positions_frac/{flag=0}flag' file1
Then I want to store the first column in an array but of the non-equivalent ones
expected output:
array= ["Si", "O"]