I have to process some very large text data files.
Each is over 100 Mb.
Here is a sample:
Quote:
system A 2008_05_24:23: ...data...
system A 2008_05_24:23: ...data...
system A 2008_05_24:23: ...data...
system A 2008_05_24:22: ...data...
system A 2008_05_24:22: ...data...
system B 2008_05_24:22: ...data...
system B 2008_05_24:22: ...data...
system A 2008_05_24:22: ...data...
system A 2008_05_24:21: ...data...
system A 2008_05_24:21: ...data...
system B 2008_05_24:21: ...data...
|
I want to insert a "-----" separator whenever there
is any difference in the first 22 characters of the
current and next line.
In other words, the above data file should look
like this:
Quote:
system A 2008_05_24:23: ...data...
system A 2008_05_24:23: ...data...
system A 2008_05_24:23: ...data...
-----
system A 2008_05_24:22: ...data...
system A 2008_05_24:22: ...data...
-----
system B 2008_05_24:22: ...data...
system B 2008_05_24:22: ...data...
-----
system A 2008_05_24:22: ...data...
-----
system A 2008_05_24:21: ...data...
system A 2008_05_24:21: ...data...
-----
system B 2008_05_24:21: ...data...
|
I am not bash script expert, I need some help.
Thanks.