Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.
SOLVED

Extract date and time in html tags

rouzu
7 - Meteor

Please suggest to me, how to parse this field to get date and time only without using filter tool.

 

 

<time datetime="2017-11-03 12:41:00" type="ago">2017-11-03 12:41:00</time>, <comment-count data="409877" format='@data; comments'>
<time datetime="2017-11-03 10:10:00" type="ago">2017-11-03 10:10:00</time>, <comment-count data="401222" format='@data; comments'>
<time datetime="2017-11-03 12:13:00" type="ago">2017-11-03 12:13:00</time>, <comment-count data="403444" format='@data; comments'>

3 REPLIES 3
jdunkerley79
ACE Emeritus
ACE Emeritus

Regex is probably easiest.

 

Two options:

 

- Formula  

IIF(
	REGEX_Match([HTML], '.*datetime="(\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2})".*'),
	REGEX_Replace([HTML], '.*datetime="(\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2})".*', "$1"),
	NULL())

 

- Regex tool in parse mode

 

Sample attached

rouzu
7 - Meteor

I think using Parse with RegEx tool  is more easier, thanks for the suggestion.. 

vishwa_0308
11 - Bolide

Hi @rouzu if you have same pattern throughout the rows then this short regex will work too:

>(.*)</time> with parse method.

 

Best,

Vishwa

Labels