Parse out every other value of concatenated string
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
I have a dataset with a column that contains long strings of data in this format:
ABC Inc. | 1234567 | DEF, co. | 8912345 | XYZ co ltd. | 6789123 |
I would like to break this string up into two separate columns as follows:
Name | Number |
ABC Inc. | DEF, co. | XYZ co ltd. | 1234567 | 8912345 | 6789123 |
Any ideas on what tool/regex formula to use?
Solved! Go to Solution.
- Labels:
- Regex
- Transformation
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Is it always only three groups or are the groupings variable?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Thank you! Sorry, forgot to mention that sometimes the number is blank, but I still want to capture that in the number column. Example below:
ABC Inc. | 1234567 | DEF, co. | | XYZ co ltd. | 6789123 |
Name | Number |
ABC Inc. | DEF, co. | XYZ co ltd. | 1234567 | | 6789123 |
Does that change anything?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
The groupings are variable and sometimes the number is missing (but there should always be a name). I still want to capture the blank number as a segment in the number column so the name and number still line up.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
@atjhsieh - here's round 2! This should accommodate for the variable groupings if there's a missing value as long as the pipes remain the same.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Thank you again, this was super helpful!
