Skip to content

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].
  • fthomas Offline
  • Posts: 8
  • Joined: Fri Feb 24, 2017 9:40 am

exclude or include a text based on it's content

Post by fthomas »

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 Offline
  • Support Specialist
  • Posts: 590
  • Joined: Tue Jul 17, 2012 2:12 pm
  • Location: Phoenix, AZ
  • Contact:

Re: exclude or include a text based on it's content

Post by Support_Rick »

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 Offline
  • Posts: 8
  • Joined: Fri Feb 24, 2017 9:40 am

Re: exclude or include a text based on it's content

Post by fthomas »

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 Offline
  • Support Specialist
  • Posts: 590
  • Joined: Tue Jul 17, 2012 2:12 pm
  • Location: Phoenix, AZ
  • Contact:

Re: exclude or include a text based on it's content

Post by Support_Rick »

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 Offline
  • Posts: 8
  • Joined: Fri Feb 24, 2017 9:40 am

Re: exclude or include a text based on it's content

Post by fthomas »

Thanks! That works perfectly!
Post Reply