InDesign CC
GREP Find & Replace
InDesign has a powerful tool in GREP Find & Replace. This is found in the Find/Change (+F) dialog under the GREP tab. At the heart of this feature is a shell language called Regular Expressions.
Regular Expressions: What's That?
Regular Expressions or RegExp (or actually RegEx sometimes) as you may see it written, is an extremely geeky but powerful string matching dialect invented in the early days of Unix for shell-scripting. The dialect hasn't (thankfully) been updated since it's invention, meaning it prooved to be reliable and thus adaptable to more than just shell-scripting some cryptic OS.
RegExp has been integrated into most code editors, including Visual Studio Code, but also into InDesign in the form of:
Find/Replace using GREP
Styling text dynamically, without having to use find/replace manually, using GREP Styles
Those will hopefully work their way into your day-to-day InDesign use habits, but for this Data Merge thing, you'll probably be using it to normalize the data.
RegExp in Find / Change
REFERENCE: extras - grep/grep find-replace.indd
RegExp in GREP Styles
extras - grep/grep styling.indd
Related Links
To learn about Regular Expressions, search the web and start reading or viewing. Some starting points:
Articles
Express Yourself – Using Regular Expressions in Graphic Design
Ryan's Tutorials: Regular Expressions Tutorials
Regular Expressions Cheat Sheet PDF
Video
Regular Expressions (Regex) Tutorial: How to Match Any Pattern of Text