I am creating an Excel spreadsheet of Cisco fabric config and want to get the format right into fields / columns for importing.
Here is the format, with amended info of course:
zone name Zone1_HOSTNAME01 vsan XXX
fcalias name STORAGEPORT_0 vsan XXX
pwwn xx:xx:xx:xx:xx
fcalias name STORAGEPORT_1 vsan XXX
pwwn xx:xx:xx:xx:xx
fcalias name STORAGEPORT_2 vsan XXX
pwwn xx:xx:xx:xx:xx
zone name Zone2_HOSTNAME02 vsan XXX
fcalias name STORAGEPORT_3 vsan XXX
pwwn xx:xx:xx:xx:xx
fcalias name STORAGEPORT_4 vsan XXX
pwwn xx:xx:xx:xx:xx
fcalias name HOSTNAME02 vsan XXX
pwwn xx:xx:xx:xx:xx
So what I want to do is to have everything in the Zone name ZONE NAME up to the " vsan" space in 1 field, and then until the next occurrence of start of line with "zone name" put each string into its own field which I can then "cut" using delimiters to get what I want. So in essence what I want to have in the end is:
"zone name Zone1_HOSTNAME01" "vsan" "XXX" "fcalias name" "STORAGEPORT_0 vsan XXX" "pwwn xx:xx:xx:xx:xx" "fcalias name" "STORAGEPORT_1 vsan XXX" "pwwn xx:xx:xx:xx:xx" "fcalias name" "STORAGEPORT_2 vsan XXX" "pwwn xx:xx:xx:xx:xx"
or something like that. Each white space can be in it's own field as I can then manipulate the columns afterwards far easier.
The text file has over 800 lines and some may be larger but it's unknown right now. The biggest issue is that the text that comes after the initial line starting with "zone name...." can be varying so I just need to translate them into their own fields regardless of what comes next.