![]() ![]() This first step might be unnecessary, but it permits me to ensure that all lines with the same record type stay in their original relative order during the second step.įrom the File menu, select Sort -> Advanced Sort Options. And, it intelligently makes them all the same width by including appropriate leading zeros. Clicking OK turns UltraEdit loose to insert line numbers all the way from beginning to end of the file. (Put cursor in first position of file (Ctrl-Home) and then "drag" to bottom with a Shift-Ctrl-End.) Then from the Column menu, select Insert Number. ![]() What I do, when I have a similar problem is the following:įirst, I go into column mode, and then "select" an insert point right in front of the first column of every record, all the way down the file. ![]() Last you can use Find In Files with your search string and with option "Results to Edit Window" and then convert the results file to ASCII if necessary and delete with a few regex replace all commands everything except the content of the found lines. You can increase the number of 2000 if it works also with a higher number.Īll the 3 macros above require an enabled macro property Continue if a Find with Replace not found.ģ) Using Find In Files to get the list of lines If the first macro has found 2000 lines and so still the named source file has the focus, the main macro pastes the found lines into the new file and calls again the first macro. If this is true, the first macro has already pasted the rest of the found lines into the new file which does not have a name. After finishing the first macro, it checks if the current file has no name. The main macro make the necessary preparations and runs in a loop the first macro. If 2000 lines are copied to clipboard, the loop exits without changing to the new file. If the string is not found anymore before 2000 lines are found, it pastes the already found lines into the new file and exits the loop. The first macro copies always a maximum of 2000 lines to user clipboard 9. I think, this solution is also quite easy to understand. This solution needs 2 macros because nested loops are not possible.Ĭreate first following macro which contains the inner loop with name "Copy2000Lines". 1) Delete all lines which does not have record 01 and save it with a new file name.Ģ) Collecting the lines of interest in a clipboard in several steps. ![]()
0 Comments
Leave a Reply. |