by Mofi » Tue Aug 03, 2004 2:43 am
UE has no macro command to go or select a specified column. So cursor moves are needed in the macro to do that.
First, I don't know, if the first line of your files have always at least 267 characters. If so, you can use Macro 2, which does not modify the source file. Macro 1 inserts a line with 267 spaces at the top of the source file. You have to expand the Replace command of Macro 1 with additionally 266 spaces before ^p.
After setting the cursor to column 267 with one of these methods, column mode is activated and everything to the end of file is selected. Because I don't know if your files end with a linefeed, the macro sets the cursor to column 1 of the last line.
Now 278 Key RIGHT ARROW are necessary in both macros to set the cursor to column 278 of the last line while selection mode is still active. Insert in both macros additionally 277 Key RIGHT ARROW.
The correct columns are now selected and copied to the new file.
In Macro 1 the inserted line with spaces is removed in the source and new file. So the data in the new file is correct and the source file is modified but has the exact content before execution of the macro.
Macro 1
InsertMode
ColumnModeOff
HexOff
UnixReOff
Top
Find RegExp "%^(*^)$"
Replace " ^p^1"
Top
Key END
ColumnModeOn
StartSelect
SelectToBottom
Key HOME
Key RIGHT ARROW
Copy
EndSelect
ColumnModeOff
Top
StartSelect
Key DOWN ARROW
EndSelect
Key DEL
NewFile
Paste
Top
StartSelect
Key DOWN ARROW
EndSelect
Key DEL
Macro 2
InsertMode
ColumnModeOff
HexOff
UnixReOff
Top
Loop
Key RIGHT ARROW
IfColNum 267
ExitLoop
EndIf
EndLoop
ColumnModeOn
StartSelect
SelectToBottom
Key HOME
Key RIGHT ARROW
Copy
EndSelect
ColumnModeOff
Top
NewFile
Paste
Top