Jump to content
Macro Express Forums

Creating documents


Recommended Posts

Need a little direction on how to create a macro that copies from a txt document and adds text to it on both sides.

 

example

 

doc 1 has a list of website address with icons for it.

 

doc 2 is where the stuff will be copied to.

 

<a href=" (to be copied) " img src=" (second part to be copied)"></a>

 

the problem that i have is that the links are not all the same size. I dont know how to limit the capture.

 

Any guidance would be greatly appreciated.

 

MBone

Link to comment
Share on other sites

Need a little direction on how to create a macro that copies from a txt document and adds text to it on both sides.

 

example

 

doc 1 has a list of website address with icons for it.

 

doc 2 is where the stuff will be copied to.

 

<a href=" (to be copied) " img src=" (second part to be copied)"></a>

 

the problem that i have is that the links are not all the same size. I dont know how to limit the capture.

 

Any guidance would be greatly appreciated.

 

MBone

You will need to write some logic into your macro so that it can locate the end of the website addresses. Probably the easiest thing to do will be to have the

macro locate a blank space. The blank space will have to be located outside the website address.

 

Here's an idea how to do this:

// Here I've established T1 containing a line of text containing a web-address and an image name (I'm assuming this is how your .txt file displays them).
Variable Set String %T1% "http://www.macros.com image123.jpg"
Variable Set Integer %N1% from Position of Text in Variable %T1%
Variable Modify String: Copy Part of %T1% to %T2%
Variable Modify String: Delete Part of %T1%
Variable Modify String: Trim %T1%
Variable Modify String: Trim %T2%
// In the end T1 contains the image file, and T2 contains the web-address

Direct Editor Script

<REM2:Here I've established T1 containing a line of text containing a web-address and an image name (I'm assuming this is how your .txt file displays them).><TVAR2:01:01:http://www.macros.com image123.jpg><IVAR2:01:13:1: ><TMVAR2:10:02:01:001:N01:><TMVAR2:11:01:00:001:N01:><TMVAR2:01:01:00:000:000:><TMVAR2:01:02:00:000:000:><REM2:In the end T1 contains the image file, and T2 contains the web-address>

Link to comment
Share on other sites

I suggest you create your source list in Excel in two columns. Then save it as a delimited text file format like CSV to Tab. Then use the ASCII File Process to plow thru that file. Don't forget to close it in Excel. Then generate an output file in MEP. See attached example.

Demo.mex

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...