Okay, so I have a rather large text file and will have to process many more and this will save me hours of work.
I'm not very good at scripting, so bear with me please.
Working on Linux RHEL
I've been able to filter and edit and clean up using sed, but I have a problem with moving lines.
For each occurence in the file (literally thousands), I need to move the line "TYPE = Router"
Below the line "<td>[[Cisco]]</td>"
After that I'll need to move other variables around and convert everything to html tables, but that I can do already.
Because I will reuse the command for the other variables in the text, it would be better to do it using matching char rather than just counting lines.
The pat2move is a RegularExpression: a * means the previous character is present zero or more times.
E.g the TYPE *= *Router matches
TYPE =Router
and
TYPE = Router
. You can also put a character class like TYPE[[:space:]]*=[[:space:]]*Router . scope is the number of following lines to search for the pat2move .
The lineBelow is a string to be compared with the whole line.