What is the best way to achieve this?
Javascript?
Too complicated for a Macro?
Another method?
I want to
(00) Go HOME/Take cursor home/Macro = Key HOME
(01) Find a string (this is a variable which would be an input to the script/process)
(02) Note the column where that first iteration of string starts
(03) Save that Column e.g. to a variable Variable Int-Column_Count
(04) Find next iteration of the string
(05) Note the column where this 2nd iteration of string starts
(06) If Column noted in 5 (2nd iteration) is greater then Int-Column_Count (first iteration)
Then
Update Int-Column_Count with this greater number
(07) Repeat Steps (5) and (6) until ther end of the file
(08) Go HOME/Take cursor home/Macro = Key HOME
(09) Find first iteration of string again
(10) Hit SPACEBAR until the string starts at column Int-Column_Count
(11) Find next iteration of string
(12) Repeat (10) and (11) until the end of the file
Assumptions
A01 There is only one iteration of string in every line
Example
String = "_M"
File Before (Line 1 String is furthest to RHS)
File After
Javascript?
Too complicated for a Macro?
Another method?
I want to
(00) Go HOME/Take cursor home/Macro = Key HOME
(01) Find a string (this is a variable which would be an input to the script/process)
(02) Note the column where that first iteration of string starts
(03) Save that Column e.g. to a variable Variable Int-Column_Count
(04) Find next iteration of the string
(05) Note the column where this 2nd iteration of string starts
(06) If Column noted in 5 (2nd iteration) is greater then Int-Column_Count (first iteration)
Then
Update Int-Column_Count with this greater number
(07) Repeat Steps (5) and (6) until ther end of the file
(08) Go HOME/Take cursor home/Macro = Key HOME
(09) Find first iteration of string again
(10) Hit SPACEBAR until the string starts at column Int-Column_Count
(11) Find next iteration of string
(12) Repeat (10) and (11) until the end of the file
Assumptions
A01 There is only one iteration of string in every line
Example
String = "_M"
File Before (Line 1 String is furthest to RHS)
Code: Select all
10.10.96.0 _M24 10.10.96.254 0 A C ae1.3
10.10.96.254 _M32 0.0.0.0 0 A H
10.10.97.128 _M30 10.10.97.130 0 A C ae1.51
10.10.97.130 _M32 0.0.0.0 0 A H
10.10.97.132 _M30 10.10.97.134 0 A C ae1.91
Code: Select all
10.10.96.0 _M24 10.10.96.254 0 A C ae1.3
10.10.96.254 _M32 0.0.0.0 0 A H
10.10.97.128 _M30 10.10.97.130 0 A C ae1.51
10.10.97.130 _M32 0.0.0.0 0 A H
10.10.97.132 _M30 10.10.97.134 0 A C ae1.91