Hi all, I've got a question regarding the Dynamic Rename tool which I'm hoping to get some help with. I'm importing a CSV file which has all Column Header titles mashed together like so: VendorClaimNumber; ItemName; CountryClaim, etc.
I'm looking for a way to dynamically add a space between the Capital Letters to change the headers to Vendor Claim Number, Item Name, etc.
I've tried a REGEX_Replace ([_CurrentField_],"\u","\s") and that didn't do it...any ideas? Thanks everyone!
Bren
Solved! Go to Solution.
Hi @Bren312
I used a few more tools than just a Dynamic Rename, but it should be easy to follow. Check out the attached workflow to see how I used RegEx to identify capitalized words, rebuild them with spaces, and rename all the fields of the original data stream.
@Bren312 ,
This is more involved because you need to dynamically address the replacement of Capital Letters with SPACE+Capital Letter (except the first). I created a replacement table for field names as shown below:
I hope that this helps and possibly teaches you something. If someone else comes up with a cleaner solution, I'll be interested.
Cheers,
Mark
In my solution I accept values with spaces as names and don't mess with them. I know that it wasn't a stated requirement, but I did add that feature.
Cheers,
Mark
Top notch; thanks Mark! Your workflow definitely taught me some things and I appreciate you taking a look at this. Thanks again and all the best!
Bren
Hi Charlie, thanks for taking a look at this. I like your solution; it's pretty sleek. Thanks again and all the best!
Bren
Thank you!! This was exactly what I was looking for. :) Worked perfectly.
User | Count |
---|---|
19 | |
14 | |
13 | |
9 | |
8 |