Compare Lists For A Containing Partial Text

winautouser

  • Joined: May 21, 2010
  • Posts: 15

Thu 8/19/2010 - 4:12

Can someone tell me how to do this? -

I have two lists that look like this -

List A

www.url1.com/directory
www.url2.com/directory
www.url3.org/directorypath
www.url4.com/directory/files

List B

www.url2.com
www.url4.com


I want to compare list B to List A and remove the lines in List A that contain the URLs in ListB.

I probably need to use a "contains" operator but I do not have the 3.1 version that was used to make the tutorial videos....

 

#1

Samantha

  • Joined: Apr 23, 2010
  • Posts: 2326

Thu 8/19/2010 - 9:50

Hello winautouser, I could create a sample job for you to do this, but if you are interested in testing this specific feature, you can send an email to the Support Dpt and ask to added in the Beta Testing Team. :) Samantha

#2

winautouser

  • Joined: May 21, 2010
  • Posts: 15

Thu 8/19/2010 - 13:11

Hi Samantha...

I actually have a beta copy now thanks to support.

If you have time I would like to see a sample job using only 3.0 functions. I tried to get this to work for a little while before I saw the tutorial video with the "contains" operator for conditionals and I kept running into problems. Seeing a sample job might help me to understand winautomation coding better since I had trouble.

 

Thanks for the great support.

 

#3

Samantha

  • Joined: Apr 23, 2010
  • Posts: 2326

Thu 8/19/2010 - 14:32

Hello winautouser, Please check the job attached, this should do the trick. You simply read the two text files and parse the first one for each line of the second one. Having done that, if the line of the second one exists on the line from the first one, then it does nothing, if it does not exist, it writes it to a list. The new list created will only have items that do not appear in the second list. So in the end, you can either replace the first list with the result list, or get it in a separate file (which is what I have done in the attached job.) Please let me know if this is what you were after :) :) Samantha

comparing lists.waj

#4

topakitz

  • Joined: Aug 21, 2010
  • Posts: 8

Wed 8/25/2010 - 17:33

Hi Samantha,

I have some question regarding comparing lists.The list I am comparing is:

ListA

  • 8/24/2010 04:30:12 AM   ***   Download file not available. Can't create Sample.txt file.
  • 8/24/2010 05:30:12 AM   ***   ERROR: Unable to connect!
  • 8/24/2010 10:30:12 AM   ***   Download file not available. Can't create Sample.txt file.
  • 8/24/2010 09:45:12 PM   ***   AUTOMATION ERROR

ListB

  • 8/24/2010 04:30:12 AM   ***   Download file not available. Can't create Sample.txt file.
  • 8/24/2010 04:30:12 AM   ***   Download file not available. Can't create Sample.txt file.
  • 8/24/2010 05:30:12 AM   ***   ERROR: Unable to connect!
  • 8/24/2010 10:30:12 AM   ***   Download file not available. Can't create Sample.txt file.

When using your exported job its says nested qualifiers in WinAutomation Error logs.

Thanks. ^_^

#5

Samantha

  • Joined: Apr 23, 2010
  • Posts: 2326

Thu 8/26/2010 - 10:03

Hello topakitz, That would be because the sample text you gave me does not correspond to the lists you just run it for, and the result of which would be that the regular expression used is no longer valid for this type of text. So if you want to run this job for this sample text, (and compare each line of the one list to each line of the second list) then you simply have to edit Action 6 of the Job to look something like this: Text to parse: %CurrentItemA% Text to find: %CurrentItemB% Is Regular expression: NO (un-check this option) Start Parsing at Position: 0 Find first occurrence only: Yes (Check this option) And it should then work :) Note here that you are no longer using part of the line but the whole line. You can use an expression to get either the date or the second part which would be the error description. Let me know if this is what you were after. :) Samantha

#6
Not a member yet? Register

Copyright 2013 - Softomotive Ltd