How do I separate two values from the same field?

Hi All,

I have the below issue:

From and excel import I have a vehicle column as below. What I would like to do is to separate the "3D" to be my Haulier Name When I do my Bootstrap and the 590544 to be my trailer Name. I Will show you the logic that I came with but the current logic does not cover haulier names with a space !!


Please see my logic:


 -- > 

Substr(ConvertFromExcel.Current.Excel_TourHistoryReport_puredataforOS2.Vehicle,Index(ConvertFromExcel.Current.Excel_TourHistoryReport_puredataforOS2.Vehicle," "),(Length(ConvertFromExcel.Current.Excel_TourHistoryReport_puredataforOS2.Vehicle) - Index(ConvertFromExcel.Current.Excel_TourHistoryReport_puredataforOS2.Vehicle," ")))

This will return "590544" for the Trailer No in the first instance but it will stop in the first space of the haulier Name in the second instance.

Any ideas please?

Thank you in anticipation.

Hi Anastasios,

It seems there's some image(?) missing showing what data you have.

Hi Kilian,

Please check now. 

Thanks 

Anastasios

Also "vehicle" is my Excel Column where I have the "3D 590544" String.

Thanks again


Hi Anastasios,

So what's the format of that specific column? Is the last sequence of digits always the trailer name, and everything that comes before is the haulier name? So "JB S" is the haulier and "45723" the carrier?

Hi Kilian,

Yes that is correct.

But I have spaces in the Haulier name which is causing me trouble in order to separate these two values.

Thanks

Hi DImou,

u can use this action to split:


regards

Hi Anastasios,

I think the easiest then is to use the Index() built-in function, it has a searchFromEnd parameter that allows you to get the last space. Once you have the index, you can use a Substr starting at the index + 1.

The Key was the +1 :) thanks Kilian!

You're welcome :). Happy coding!

Financial Freedom wrote:

Hi DImou,

u can use this action to split:


regards


I use this method either. Much easier.


Behavioral wrote:

Financial Freedom wrote:

Hi DImou,

u can use this action to split:


regards


I use this method either. Much easier.



Hi,

where can you get this action please?

thanks

Anastasios

Hi Anastasios,

As you can see, String_Split is part of the Text Extension. However, in this case it's pretty useless and overkill, so ignore Financial and Behvioral :).