Skip to main content
Solved

Separate two different entities from one column

  • December 22, 2014
  • 7 replies
  • 237 views

Forum|alt.badge.img
Hi,

 

 

I have a column named DateTime in a table. The format of date and time is as follows:

 

 

9/9/2009 21:23:31

 

25/12/1991 8:3:23

 

 

means There is a space b/w date and time. Date Month Year is seperated by '/' and time by ':'

 

Now, I need to seperate date and time. I want two new attributes Date and Time with respected outputs. Thanks in advance.

 

 

Best answer by takashi

The AttributeSplitter will not change the original attribute, split result will be stored in a list attribute.

 

e.g.

 

_list{0} = '9/9/2009'

 

_list{1} = '21:23:31'

 

 

You can then rename them with the AttributeRenamer, if necessary.

 

_list{0} => Date

 

_list{1} => Time
View original
Did this help you find an answer to your question?

7 replies

takashi
Influencer
  • December 22, 2014
Hi, I would use the AttributeSplitter with setting Delimiter to a whitespace.

 

Takashi

fmelizard
Safer
Forum|alt.badge.img+18
  • Safer
  • December 22, 2014
Hi,

 

I would use the AttributeSplitter (set on ' ' [space]) and remap the list elements into your output attributes.

 

Itay

 

 

Forum|alt.badge.img
  • Author
  • December 22, 2014
Thanks for the reply.

 

@Takashi: I tried setting Delimiter to a whitespace, but there is no change in the output while doing that.

 

@Itay: I am not aware of remapping the list elements.

takashi
Influencer
  • Best Answer
  • December 22, 2014
The AttributeSplitter will not change the original attribute, split result will be stored in a list attribute.

 

e.g.

 

_list{0} = '9/9/2009'

 

_list{1} = '21:23:31'

 

 

You can then rename them with the AttributeRenamer, if necessary.

 

_list{0} => Date

 

_list{1} => Time

fmelizard
Safer
Forum|alt.badge.img+18
  • Safer
  • December 22, 2014
exactly what Takashi means....

takashi wrote:
The AttributeSplitter will not change the original attribute, split result will be stored in a list attribute.

 

e.g.

 

_list{0} = '9/9/2009'

 

_list{1} = '21:23:31'

 

 

You can then rename them with the AttributeRenamer, if necessary.

 

_list{0} => Date

 

_list{1} => Time

How to split datetime column if there is no whitespace or delimiter character available. for example how to split "19960108031100" into date and time?


alc33
Contributor
Forum|alt.badge.img+10
  • Contributor
  • January 20, 2020
muhammad_yasir wrote:

How to split datetime column if there is no whitespace or delimiter character available. for example how to split "19960108031100" into date and time?

Hi! If the length don't change, you can use Attribute manager. You create 2 new attribute with string formula. With left or rigth function you can extract the values. Then remove the original attribute if you want.


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings