Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi all,
How can extract the date only ?
Exemple in my script :
LOAD Field FROM File;
Where Field = date=2013-01-31 Time=17:09:45 ip=192.122.123.13.11
I tried: (Field,index(Field,'=')+1) as Date but It doesn't work. I just want to obtain the date.
How can I get the string before thie operator " = " ? (dynamicallly).
I would like to get
LOAD
Field 1 as Date
Field 2 as Time
Field 3 as IPAddress
FROM FILE.
Thank for your help,
Hi,
Perhaps you could try the TEXTBETWEEN function
TextBetween (string, delimiter 1, delimiter 2)
where delimiter1 = "=" and delimiter2 = "TIME="
Fabrice
use the following expressions for loading the date, time & IP
IP string: Subfield(Subfield('date=2013-01-31 Time=17:09:45 ip=192.122.123.13.11', '=', 4), ' ', 1)
Time string: Subfield(Subfield('date=2013-01-31 Time=17:09:45 ip=192.122.123.13.11', '=', 3), ' ', 1)
Date String: Subfield(Subfield('date=2013-01-31 Time=17:09:45 ip=192.122.123.13.11', '=', 2), ' ', 1)
hope this helps...
Hi,
To get Date
=Date#(SubField(SubField('date=2013-01-31 Time=17:09:45 ip=192.122.123.13.11','Time=',1),'date=',2), 'YYYY-MM-DD')
Time
Time#(SubField(SubField('date=2013-01-31 Time=17:09:45 ip=192.122.123.13.11','ip=',1),'Time=',2), 'HH:mm:ss')
IP
SubField('date=2013-01-31 Time=17:09:45 ip=192.122.123.13.11','ip=',1)