Reputation: 2430
I have a file which looks like this :
{
"0" : NumberLong(654654),
"1" : NumberLong(31321),
"2" : NumberLong(44534564),
"3" : NumberLong(464564645),
}
My output should be something like this :
654654
31321
44534564
464564645
I tried to do this :
grep -Po ' NumberLong\("\K[^"]*' file
But it doesn't seem to work for me.
Upvotes: 0
Views: 78
Reputation: 98
Use this:
grep -Po "(?<=\()[^)]+" data.txt
654654
31321
44534564
464564645
Upvotes: 0
Reputation: 784918
Try this grep:
grep -Po ' NumberLong\(\K[^)]*' file
654654
31321
44534564
464564645
OR this grep:
grep -Po ' NumberLong\(\K\d+' file
654654
31321
44534564
464564645
Upvotes: 2