giton Posted March 25, 2008 Report Share Posted March 25, 2008 I've got a macro set up for TextPad to find a text string using "Find in Files" and then save the search results. What I need is to clean up the labeling that TextPad inserts (as a reference to the files where the strings were found), leaving me with just the text I searched for. In the end I'll be importing the text into another program, so that's why I need the specific formatting. What I'm trying to figure out for the moment is how to get a macro to search each line of text for a colon (":") and then delete it and everything preceding it on that line, then repeat till the last line of the text file. Any suggestions? Or improvements on the overall scheme? Quote Link to comment Share on other sites More sharing options...
stan Posted March 25, 2008 Report Share Posted March 25, 2008 It looks like you should be able to do this in 5 steps. Text File Begin Process: "sample.txt" Variable Set Integer %N1% from Position of Text in Variable %T1% Variable Modify String: Delete Part of %T1% Variable Modify String: Append %T1% to Text File Text File End Process Step 1 reads the first line of your text file and saves to T1. Step 2 finds the position of the : character in the text string and saves it to N1 Step 3 deletes part of the text string - start at position one and delete N1 number of characters Step 4 saves the new smaller string to a new text file. Select the Add Trailing CR/LF option. Step 5 closes the loop and repeats the process for the next line in the text file. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.