Basically I have a file with these contents:
Code: Select all
[99]
TriggerTop = [Monitor2Top] + ([Monitor2Height] / 10 * 1)
TriggerBottom = [Monitor2Top] + ([Monitor2Height] / 10 * 2)
TriggerLeft = [Monitor2Left] + ([Monitor2Width] / 10 * 8)
TriggerRight = [Monitor2Left] + ([Monitor2Width] / 10 * 9)
GridTop = [Monitor2Top]
GridBottom = [Monitor2Top] + ([Monitor2Height] /2)
GridLeft = [Monitor2Right] - ([Monitor2Width] /2)
GridRight = [Monitor2Right]
[100]
TriggerTop = [Monitor2Top] + ([Monitor2Height] / 10 * 1)
TriggerBottom = [Monitor2Top] + ([Monitor2Height] / 10 * 2)
TriggerLeft = [Monitor2Left] + ([Monitor2Width] / 10 * 7)
TriggerRight = [Monitor2Left] + ([Monitor2Width] / 10 * 8)
GridTop = [Monitor2Top]
GridBottom = [Monitor2Top] + ([Monitor2Height] /2)
GridLeft = [Monitor2Right] - ([Monitor2Width] /3*2)
GridRight = [Monitor2Right]
[101]
TriggerTop = [Monitor2Top] + ([Monitor2Height] / 10 * 2)
TriggerBottom = [Monitor2Top] + ([Monitor2Height] / 10 * 3)
TriggerLeft = [Monitor2Left] + ([Monitor2Width] / 10 * 9)
TriggerRight = [Monitor2Left] + ([Monitor2Width] / 10 * 10)
GridTop = [Monitor2Top]
GridBottom = [Monitor2Top] + ([Monitor2Height] /3*2)
GridLeft = [Monitor2Right] - ([Monitor2Width] /3)
GridRight = [Monitor2Right]
[333]
[334]
[335]
So far I think I can use "seq 333 444" in a for loop but can't figure out how to insert the 8 trailing lines in the right order.
I also found the regex to match the needed lines: /^[.*.\]
I think I might be able to do this using sed alone but no luck so far.