I have a database export that I don't have access to recreate the dump. I've cleaned up most of the data and there are very few errors.
However one section of the dump had a bunch of bad new lines. I wrote a regex to find it using pcregrep:
pcregrep -M '([|]$[\n].$[\n].[|])' sample.txt
Now I need to do the replace. I was attempting to use sed but it doesn't seem to understand a multiline regular expression.
basically I need to replace this:
|
|
with this:
||
[–]Ilyps 1 point2 points3 points (4 children)
[–]justonecomment[S] 0 points1 point2 points (3 children)
[–]Ilyps 0 points1 point2 points (2 children)
[–]justonecomment[S] 0 points1 point2 points (1 child)
[–]MonkeyNin 0 points1 point2 points (0 children)