Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

This topic is 7358 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

I need to parse this line of text with script maker into different fields.

Text:

9/30/2004|6:59:35 PM|Test Co.|Test Co. 111

to

Date = 9/30/2004

Time =6:59:35 PM

text1 = Test Co.

text2 = Test Co. 111

I used pipes "|" instead of the return character (for separators) as I thought it may interferer with the data in some the fields that may have returns.

Thanks

FM7

Posted

You don't need script you need calcaulations! Using the field Input for your original text the calcaulations are:

Date = GetAsDate ( Left( Input ; Position ( Input ; "|" ; 1 ; 1 ) - 1))

Time = GetAsTime ( Middle ( Input ; Position ( Input ; "|" ; 1 ; 1 ) + 1 ; Position ( Input ; "|" ; 1 ; 2 ) - Position ( Input ; "|" ; 1 ; 1 ) - 1 ) )

Text1 = Middle ( Input ; Position ( Input ; "|" ; 1 ; 2 ) + 1 ; Position ( Input ; "|" ; 1 ; 3 ) - Position ( Input ; "|" ; 1 ; 2 ) - 1 )

Text2 = Right ( Input ; Length ( Input ) - Position ( Input ; "|" ; 1 ; 3 ))

Make sure the calculations are the correct type.

This topic is 7358 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.