I have been Googling my way through manipulating a configuration file to migrate data to another operating system using Notepad++. I have been successful thus far with the plethora of examples and help online with Notepad++. However, I've hit a road block that I'm not able to overcome and require assistance. Here's my plight...
I have a config file of objects, but they are presented in the wrong order for building the command set I need to make this useable. All of the data is presented in an incorrect order. Line 1 should be appended to the end of Line 2, Line 3 should be appended to the end of Line 4, Line 5 should be appended to the end of Line 6, and so on...
static "PMDC1-2019"
set device-group plymouth_meeting address-group "DNS Servers"
static "PMDC2-2019"
set device-group plymouth_meeting address-group "DNS Servers"
static "ExtonDC-2019"
set device-group plymouth_meeting address-group "DNS Servers"
static "wellcall-lodidc"
set device-group plymouth_meeting address-group "DNS Servers"
The end result should be as follows:
set device-group plymouth_meeting address-group "DNS Servers" static "PMDC1-2019"
set device-group plymouth_meeting address-group "DNS Servers" static "PMDC2-2019"
set device-group plymouth_meeting address-group "DNS Servers" static "ExtonDC-2019"
set device-group plymouth_meeting address-group "DNS Servers" static "wellcall-lodidc"
All suggestions and assistance are welcome and appreciated! Thank you.
I've tried to piece together found extended and regex examples without luck. I tried the option and parenthesis method to capture the data and insert it, but failed with that as well. I guess my inexperience with these variables and programming logic are getting the best of me.
^(.+)\R(.+)$
$2 $1
. matches newline
Explanation:
^ # beginning of line
(.+) # group 1, 1 or more any character
\R # any kind of linebreak
(.+) # group 2, 1 or more any character
$ # end of line
Screenshot (before):
Screenshot (after):