agentfox Posted September 11, 2007 Report Share Posted September 11, 2007 i think it sounds very simple, but i'm a beginner with macro express: i want to serach all .txt files in a folder for a string in the second line "abcabc". if it is found, the file should be moved into folder a, if not into folder b. any ideas for me? Quote Link to comment Share on other sites More sharing options...
Cory Posted September 12, 2007 Report Share Posted September 12, 2007 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. 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.