sed - line processing depending on previous line match
1 Attachment(s)
Hallo,
i'm trying to convert a colored Android system log (logcat with ANSI escape sequences) to vbulletin color codes. My first script looks like this and works so far but is not optimal due to duplicates. Code:
sed '/\x1b/ { PHP Code:
PHP Code:
Any ideas? Example logcat is attached. . |
Well if it can be done I am sure one of the sed-ninjas will jump in, but for such task I would probably use awk, ruby or perl as sed, I find, is a bit clumsy in the method to save data while processing
the next line and so on |
My first reaction is "why do you care" ?.
If the possibility exists for long runs of the same colour, I would post-process to get rid of the "duplicates" - much easier than holding several/many lines until a mismatch. I'd probably use awk, but almost anything will do - post-process should only need to manage 2 lines at a time. |
All times are GMT -5. The time now is 07:59 PM. |