Jump to content
Macro Express Forums

Parsing a Messy Text File for values


Recommended Posts

Hello all, thank you for taking the time to read and/or reply!

 

I have been charged with writing a macro that will parse a somewhat messy text file automatically generated by a program in search of a few values. All of the fields are listed first, i.e.: “Invoice Number Payment Delivery Method Expiration Date etc.” (all separated by tabs) and the actual values for each field are listed at the end in the same respective order (i.e.: 3487242 USPS 10/13/2011 etc.” . I only need a few of the values out of all this information, but can’t figure out a clean way to do it without being so convoluted as to make the macro insanely long. Any help would be greatly appreciated!

 

Thank you.

Link to comment
Share on other sites

I do this thing all the time and there are different tactics depending on the exact circumstances. Perhaps you could post a sample? In this case it sounds like using the ASCII File Process feature would be best. You can treat the text as a tab delimited file. Another approach I often use is to simply use the Split command as often the desired text will always appear as the same element. In extreme cases regex via the External Script command works wonders but the concept is fairly advanced for most.

 

Shameless plug: I do this for a living so if you need some help I’m available. Initial phone consultation is free. I believe that spending a few bucks with me can often result in saving you a lot of time experimenting and figuring things out for yourself.

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...
×
×
  • Create New...