Macro for creating blocks with a template and a word list

Help with writing and playing macros

Macro for creating blocks with a template and a word list

Postby ReaX » Sun Mar 01, 2009 3:56 am

Hi

2 text files (test_1.txt and test_2.txt)

test_1.txt
545
224
567
744
434
...
about 100 lines

test_2.txt
bb*sd
ds*iia
ss*lfa
fd*mm
kl*uy
...
about 500 lines

The result after launching a macro

bb545sd
ds545iia
ss545lfa
fd545mm
kl545uy
...
bb224sd
ds224iia
ss224lfa
fd224mm
kl224uy
...
bb567sd
ds567iia
ss567lfa
fd567mm
kl567uy
...
bb744sd
ds744iia
ss744lfa
fd744mm
kl744uy
...
bb434sd
ds434iia
ss434lfa
fd434mm
kl434uy
...

How to write the macro?

Thank you.
ReaX
Newbie
 
Posts: 2
Joined: Wed Feb 25, 2009 1:33 am

Re: Macro for creating blocks with a template and a word list

Postby Mofi » Sun Mar 01, 2009 8:47 am

Okay, here is the macro. It is important that only the 2 files are open and file test_2.txt has the focus when you start the macro.

InsertMode
ColumnModeOff
HexOff
UnixReOff
Bottom
IfColNumGt 1
InsertLine
IfColNumGt 1
DeleteToStartofLine
EndIf
EndIf
SelectAll
Clipboard 9
Copy
CloseFile NoSave
NewFile
NextWindow
Bottom
IfColNumGt 1
InsertLine
IfColNumGt 1
DeleteToStartofLine
EndIf
EndIf
Top
Clipboard 8
Loop
IfEof
ExitLoop
EndIf
StartSelect
Key END
Copy
EndSelect
Key DOWN ARROW
Key HOME
IfColNumGt 1
Key HOME
EndIf
PreviousWindow
"InSeRtEdHeRe"
Clipboard 9
Paste
GotoBookMark -1
Find MatchCase Up "InSeRtEdHeRe"
Replace ""
Clipboard 8
Find MatchCase "*"
Replace All "^c"
Bottom
NextWindow
EndLoop
ClearClipboard
Clipboard 9
ClearClipboard
Clipboard 0
CloseFile NoSave
Top
User avatar
Mofi
Grand Master
Grand Master
 
Posts: 4066
Joined: Thu Jul 29, 2004 11:00 pm
Location: Vienna

Re: Macro for creating blocks with a template and a word list

Postby ReaX » Tue Mar 03, 2009 6:53 am

Thank you.
ReaX
Newbie
 
Posts: 2
Joined: Wed Feb 25, 2009 1:33 am


Return to Macros