Jump to content
Macro Express Forums

Search String In Text File, Then Move


Recommended Posts

Sure. Use Windows Search and choose the option to search for text within files.


But if it’s only on the second line you want to limit your search for then we need ME. First do a repeat with folder to plow thru all the files. If there are more than text files then you need to extract the extension from the path and add a condition that will pass on files that don’t have a “.txt” extension.


Now that you have the file name do a Text File Begin Process. This normally reads each line into a text var as a repeat loop but you can tell it to start at row 2 and only process one row. Once it exits the loop your text var is now set to the second line of the file.


Now all you have to do it add a condition to If Variable – Contains to determine if your text is in there. If it is move the file to Folder A. You will need to have an Else part to this condition and in the Else move to folder B.


Anyway that’s how I would do it. But I haven’t finished my first cup of joe yet.

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.

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.

  • Create New...