"mail merge"-ish behavior?

This forum is user-to-user based and not regularly monitored by IDM.
Please see the note at the top of this page on how to contact IDM.

"mail merge"-ish behavior?

Postby Quadko » Tue Oct 31, 2006 7:01 pm

I've got a template file and CSV file of values. I need to generate a set of files that fill the data into the template.

Is this something I can do using UE, or do you have any other tool recommendations? It's essentially a "mail merge" to generate .cmd script files...

Thanks!
User avatar
Quadko
Newbie
 
Posts: 9
Joined: Thu Aug 18, 2005 11:00 pm

Re: "mail merge"-ish behavior?

Postby Bego » Tue Oct 31, 2006 7:54 pm

Give me an example please!
User avatar
Bego
Master
Master
 
Posts: 357
Joined: Wed Nov 24, 2004 12:00 am
Location: Germany

Re: "mail merge"-ish behavior?

Postby Quadko » Tue Oct 31, 2006 9:03 pm

I have a CSV file:
Code: Select all
12, "RunEngine1.exe test1.xml >> output.txt"
15, "RunEngine3.exe MyInput.xml /opt >> output.txt"

I have a template file:
Code: Select all
SetupTest.exe /name=%1
%2
Record %1
cleanup.exe

From the above, I want 2 output files "test12.cmd" and "test15.t" that look like:
Code: Select all
SetupTest.exe /name=12
RunEngine1.exe test1.xml >> output.txt
Record 12
cleanup.exe

I have 500+ of these I want to generate
User avatar
Quadko
Newbie
 
Posts: 9
Joined: Thu Aug 18, 2005 11:00 pm

Re: "mail merge"-ish behavior?

Postby Bego » Tue Oct 31, 2006 9:36 pm

hi Quadko,

well, this is NO problem at all. Only a time problem of me ;-)

Its late in Germany (and I have kids) and I got no more time, BUT I made a macro YOU can enhance easily.
I just saved the first line to test12.cmd.
Just enhance the macro yourself by following my "starter".macro.
Adopt the 2nd line also and put this stuff in a loop and you're done.

Code: Select all
InsertMode
ColumnModeOff
HexOff
PerlReOn
Top
Clipboard 1
StartSelect
Key Ctrl+RIGHT ARROW
Copy
EndSelect
Key RIGHT ARROW
Key RIGHT ARROW
Clipboard 2
StartSelect
Key END
Copy
NewFile
"SetupTest.exe /name="
Clipboard 1
Paste
"
"
Clipboard 2
Paste
"
Record "
Clipboard 1
Paste
"
cleanup.exe
"
Clipboard 1
SaveAs "C:\test^c.cmd"
CloseFile

<now move down to second line and do almost the same.>
<repeat that until EOF. >

OUTPUT:
SetupTest.exe /name=12
"RunEngine1.exe test1.xml >> output.txt"
Record 12
cleanup.exe

rds Bego
User avatar
Bego
Master
Master
 
Posts: 357
Joined: Wed Nov 24, 2004 12:00 am
Location: Germany

Re: "mail merge"-ish behavior?

Postby Quadko » Tue Oct 31, 2006 9:53 pm

Thanks, Bego!
User avatar
Quadko
Newbie
 
Posts: 9
Joined: Thu Aug 18, 2005 11:00 pm


Return to UltraEdit General Discussion