exclude or include a text based on it's content

Post any question you may have in regards to GoAnywhere MFT and let our talented support staff and other users assist you.
If you need a quicker response, please create a support ticket via the customer portal my.goanywhere.com or contact our support team by email at [email protected].
5 posts Page 1 of 1

fthomas

Posts: 8
Joined: Fri Feb 24, 2017 9:40 am

Post by fthomas » Tue Mar 07, 2017 5:29 pm
I have a situation where there are multiple text files but I only want to process the files that a have a certain line IN the file. Search and replace seemed like a possibility using the output files variable. However that seems to be all the files it processed. Is there a better way to accomplish this?

Support_Rick

Support Specialist
Posts: 590
Joined: Tue Jul 17, 2012 2:12 pm
Location: Phoenix, AZ

Post by Support_Rick » Wed Mar 08, 2017 9:02 am
If these are relatively small files .. then, do a loop through your files, set the file contents to a variable "FileContents", then use the "Contains" function see if "FileContents" has the value you're looking for. Condition based on results...
Rick Elliott
Lead Solutions Consultant
(402) 944.4242
(800) 949-4696

fthomas

Posts: 8
Joined: Fri Feb 24, 2017 9:40 am

Post by fthomas » Wed Mar 08, 2017 3:43 pm
Do you mean using a Read task to store it in a variable? If so, isn't that a row by row examination and not the whole text file?

Then use an IF task to decide what to do with it?

Support_Rick

Support Specialist
Posts: 590
Joined: Tue Jul 17, 2012 2:12 pm
Location: Phoenix, AZ

Post by Support_Rick » Wed Mar 08, 2017 3:55 pm
Set Variable Task ... not a Read Task.

Then use an if condition to see if the variable "contains" the value you are seeking.
Rick Elliott
Lead Solutions Consultant
(402) 944.4242
(800) 949-4696

fthomas

Posts: 8
Joined: Fri Feb 24, 2017 9:40 am

Post by fthomas » Thu Mar 09, 2017 1:02 pm
Thanks! That works perfectly!
5 posts Page 1 of 1