Hello I am looking for help and resources on parsing with regex or other tools. Basically I have two different types of string fields with important information I would like to extract.
Current:
Description |
1/8 - 1/24/2022 charge for room TAYA-0521-A1 for 1/8/2022-1/24/2022 (16 night(s)) @ $4,911.00/p/120 Night Session |
1/8 - 5/8/2022 charge for room VBGA-0641-B1 for 120 night(s) @ $2,511.00/p/120 Night Session |
Expected:
Date Range | Room | Used | Price | Empty |
1/8 - 1/24/2022 | TAYA-0521-A1 | 16 | $4,911.00 | 104 |
1/8 - 5/8/2022 | VBGA-0641-B1 | 120 | $5,211.00 | 0 |
Solved! Go to Solution.
Hey @ghtill,
There is a lot to unpack in my solution. Essentially I used a few regex expressions to identify the text patterns you want:
If you want to learn more about Regex the community has some really quick interactive videos on getting to grips with it here https://community.alteryx.com/t5/Interactive-Lessons/tkb-p/interactive-lessons/label-name/Parsing%20...
Any questions or issues please ask
Ira Watt
Technical Consultant
Watt@Bulien.com
@Emmanuel_G now that is an impressive regex solution 😮!
@IraWatt Thank you dude !
I think the flaw of this regex is that I find it sticks too much to the data of the two lines.
If we had an entire dataset, I think it would generalize better, but that's actually not bad. 🙂
@Emmanuel_G and @IraWatt Your solutions and regex resources helped me understand this process better. Thank you!
No worries @ghtill 😄 have a good weekend!