in reply to repeat data at one line and grep as pre-set format
I think you want to split each pair of data points out to a line on its own instead of having multiple datapoints on one line.
cat yourfile.txt | perl -ple 's/(\S+\s+\S+)\s+/$1\n/g'should do this for you as long as you have even numbers of datapoints on each line
echo "00000001 99888 00000011 99889 00000002 99890 00000003 998 +08" \ | perl -ple 's/(\S+\s+\S+)\s+/$1\n/g' 00000001 99888 00000011 99889 00000002 99890 00000003 99808
Cheers,
R.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: repeat data at one line and grep as pre-set format
by davido (Cardinal) on Jan 24, 2006 at 18:32 UTC | |
by Random_Walk (Prior) on Jan 25, 2006 at 09:58 UTC |