24322RE: [Clip] Using toolbar on multiple, separated lines
- Jan 27, 2014
The line order cannot be changed, and every '1' is separated from every other '1' by 9 lines. Think of it as 1000 lines numbered 1-1000, and we want to lower case only the ones whose line number ends with '0'. I don’t' need logic to figure out which ones need changing, I need to understand it is possible to select those 100 lines at one time, and use the toolbar on them, (or any other method that doesn't require a find/loop.)
The simplest test case would be two lines starting with 1, separated by one line starting with 2. Change those two lines with one command, not a loop.
John - its not clear whether all the '1' lines are together (ie. file is sorted or can be sorted and left that way)
For now - assume yes ...
(1) use a regex to change all \R to any unique string not present in input data resulting in a single line (say ####)
(2) Select the line and set sentence case Shift+Ctrl+U or in a clip
-- ^!Menu Modify/"Text case"/Sentence
(3) Change all the #### back to \r\n
If not yes above before (1) use ^!Menu Lines\"Number lines" then a clip replace to swap the line number and the line id and sort ascending then steps 1 to 3 above
After step 3 to recover original order re-swap line-id and line number, sort ascending and use a regex to remove the line numbers.
Note: AFAICT the Number lines step requires an [OK] or entry of a line number followed by [OK]. As it happens, the Sample code library contains a Perl numLines script if you want no keyboard entry.
@anyone - is there any clip commands that avoids the manual entry for ^!Menu Lines\"Number lines"?
On 2014-01-26 19:22, John Shotsky wrote:
I'm looking for a way to use the toolbar 'sentence case' command on selected, but separate lines in a a file. Let's just say every line is upper case, is numbered 1-9, and for each line numbered 1, I want to sentence case ALL of them, using ONE command. I realize this is probably not possible, but thought I'd ask. I was thinking the doclist command, maybe in some way. I know how to do it using a 'Find' and a loop to do it, but I didn't want to operate the toolbar command on 1000 lines when it might be possible to do it just once.
Regards ... Alec (buralex@gmail & WinLiveMess - alec.m.burgess@skype)
- << Previous post in topic Next post in topic >>