I have a file with lines in the following pattern:
136x2340+1564+0
that is, <N1>x<N2>+<N3>+<N4>.
I'd like to filter (maybe with grep) all lines such that N1 range is from a to b and N2 range is from c to d.
The constants a,b,c,d depend on my problem. I'll fix them in the script.
I tried egrep '^([0-9][0-9][0-9]x[0-9][0-9][0-9]+)' but the output shows
136x2340+1564+0
835x428+355+1780
817x406+186+747
114x1533+1256+456
that is, also shows lines with N2 with 4 digits (I supposed only 3 digits).
edit: also I'd like to replace x by , (comma), the first + sign by (empty space) and the second + sign by , (comma) so the output should be
N1,N2 N3,N4