by oracledba » Fri Jan 21, 2005 12:22 pm
Basicaly your reqeust how to do a database join of two tables. An editor is not the best tool to do this. MS-access is more what you want.
That said. You CAN do this with UE.
The following macro takes some shortcuts because I dont want to take the time to be pretty. The shortcuts presume your willing to do a few manual steps but even these manual steps can easily be made into macro code.
You need to do some manual steps for this macro to work.
step 1) manually copy all of file "b" into a new window (this will eventually be your file "c".
step 2) on the next line put some unique string so you can find it later
step 3) manually copy all of file "a" on the line after the unique string.
step 4) place your cursor on the what was the first line of file "a'".
You have just completed all the steps need for the following macro code to work and produce your file "c".
Play the following macro.
What it does is place a unique string on this current record. In this case its "asdf"
It then highlights the next three chars.
It then does a find of the selected text in the UP direction.
What this does is take us to that tag word already resolved.
We go to end of that line and selet the preceeding word.
we now find our unique "asdf" tag.
go to end of this line and paste. We have just completed this record.
We do every record in file till we hit end of file.
When macro has finished. your 99% done. all you need to do is
remove what was the original file "b". (go to top, search for your unique string and CUT.
Now your DONE. This new file should be exactly what you wanted.
Enjoy.
InsertMode
ColumnModeOff
HexOff
UnixReOff
Loop
IfEof
ExitMacro
EndIf
"asdf"
StartSelect
Key RIGHT ARROW
Key RIGHT ARROW
Key RIGHT ARROW
Find RegExp Up "^s"
EndSelect
Key END
StartSelect
Key Ctrl+LEFT ARROW
Copy
EndSelect
Key RIGHT ARROW
Find RegExp "asdf"
StartSelect
Key BACKSPACE
EndSelect
Key END
" "
Paste
Key HOME
Key DOWN ARROW
EndLoop