I'm trying to extract some text using awk.
Here is the sample file:
...
var a=2;
var x=[
0, 1;
1,0;
2,1;
3,2];
other text
//this is a comment with brackets []
So, when I execute the following command :
awk '/var/ , /;/' file
I obtain :
var a=2;
var x=[
0, 1;
Result expected :
var a=2;
var x=[
0, 1;
1,0;
2,1;
3,2];
Logically, the previous command took the first ;
and print the result.
The process should ignore ;
if that one is matching with the following regex: ^[\t\ ]{1,}[0-9,]{1,}.*;$
Do you have any idea about it?