• 0

# Parse a Comma Separated Field

## Question

Hello,

How do you parse a comma separated field into two fields on a Datapage?

• Here is what I have:  Smith, John (in one field)
• What I need is: Smith John (in separate fields)

Thanks,

Bill

## Recommended Posts

• 0

Hi,

In case someone might be loooking for this solution, I am attaching a solution of five formulas that will extract the nth element in a delimiter-separated list on string (in this case, the delimiter is a semi-colon).

https://howto.caspio.com/apps/importing-an-app/

Hope this helps,

DN31337

##### Share on other sites

• 0

Sometime ago a used this kind of formula to parse large amounts of users FullName info

First Name:

IsNull(Left([@field:FullName],(Patindex('%,%', [@field:FullName])-1)),' ')

Last Name:

IsNull(Right([@field:FullName],(
Len([@field:FullName])-Patindex('%,%', [@field:FullName]))),' ')

Formula for Parsing Values formCollumn: FullName

##### Share on other sites

• 0

George43,

I copied your formula to parse a field called "Code_Description". I just wanted to get the "Code" piece in a separate field and the field format is Code_Description. Here is what I used:

IsNull(Left([@field:Code_Description],(Patindex('%_%', [@field:Code_Description])-1)),' ')

The formula checks out good but is not returning the "Code". Thoughts?

Thanks

##### Share on other sites

• 0

Hi Everyone, you may want to check their functions to know what type that can be most useful. You can check it here for more information.

- Natoy

##### Share on other sites

• 0

Hi,

Here's another way to extract the "Code" text in your feild:

SUBSTRING([@field:Code_Description],0, CHARINDEX('_',[@field:Code_Description]))

On 5/14/2019 at 8:27 AM, bbeshlian said:

George43,

I copied your formula to parse a field called "Code_Description". I just wanted to get the "Code" piece in a separate field and the field format is Code_Description. Here is what I used:

IsNull(Left([@field:Code_Description],(Patindex('%_%', [@field:Code_Description])-1)),' ')

The formula checks out good but is not returning the "Code". Thoughts?

Thanks

## Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

×   Pasted as rich text.   Paste as plain text instead

Only 75 emoji are allowed.

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.