Date Extraction - Tricky Case

What follows is a video demo showing how to extract dates when date information is spread into multiple places, along with a transcript of the video.

Video transcript:

This video will show you how to extract the date and time on a site that has date information spread into multiple places. It is recommended to complete the tutorial on Simple Date Extraction before watching this video.

I have made this robot to extract my Skype call history. It logs into Skype and loops through a table which contains my history. The only problem is that the year is not stated directly in the date and time column but only in the blue bar above. Somehow I have to combine the two pieces of information. Luckily this is easily done using converters.

Before entering the loop I add a step which extracts the text in the top bar into the variable called Year. Inside the loop I insert a new step which I choose to have the Extract action. Then I select the date tag from the first row of the table and use the yellow square button to the right of the Address Bar to use it in the Extract step.

Now, to combine this extraction with the Year variable, I add a converter under the Action tab of the extract step. I choose the converter called Evaluate Expression which allows me to append the value from the variable Year to the extracted date.

An Evaluate Expression Configuration window opens. The Test Input field shows the date as extracted. In the Expression field I simply write "INPUT" with capital letters, which is the extracted date. I follow this by a plus and a space in quotation marks, this adds a space after the date. Then I add another plus followed by "Year", representing the variable containing the year which we extracted earlier.

Looking at the Test Output I verify that the two extractions have been combined into one text. To learn more about expressions I can click the question mark next to the Expression field. Click OK.

I now add another converter, the same as used in the Simple Date Extraction Tutorial, called Extract Date. The Output of the previous converter is used as input for this converter.

The configuration window opens for the Extract Date converter and I insert a new Format pattern and delete the default one given by Design Studio. Now, just as in the Simple Date Extraction Tutorial, I add the pattern to extract the date from the test input and let the converter convert the date to the standard date format. "MM dd hh:mm MM yyyy". The month is given two times but that is not a problem. The first occurrence will simply be ignored.

I click OK, choose to extract into the Date variable and check that the date and time has been extracted successfully.

That concludes this tutorial and demo on extraction of dates.