I am using notepad++, I have wrote few regex which have eased my work in formatting file. However to format the file in desired format I have to execute multiple regex, I wanted to know is there some possible way where I will store my list of regular expression and it will execute one after another.
Here is the file tree.txt which needs to be formatted.
overview/Main_Overview/Gas Management/BOG MV/BOG MV Process Alarms:Tag=BOG Heaters Process Alarms:Device=:Color=-3355444
overview/Main_Overview/Gas Management/BOG MV/BOG MV Process Trip:Tag=BOG Heaters Process Alarms-1:Device=:Color=-3355444
overview/Main_Overview/Gas Management/BOG MV/BOG MV External Trip:Tag=BOG Heaters Process Alarms-1-1:Device=:Color=-3355444
The regex will truncate above text and arrange in this sed format.
s/BOG Heaters Process Alarms:/BOG MV Process Alarms:/g
s/BOG Heaters Process Alarms-1:/BOG MV Process Trip:/g
s/BOG Heaters Process Alarms-1-1:/BOG MV External Trip:/g
To achieve the above result I will do some set of regex operation one after another.
Find- .*/
Replace-
Find- Device=:.*
Replace-
Find- :Tag=
Replace- /
Find- (^.*/)([^/]+):
Replace- /\2/ \1
Find- ^
Replace- s
Find- $
Replace- g
After above regex I get the desired format however I need to know if this can be combined so that I don't need to do manually after each expression gets completed or reduce to one expression. Thanks