I have a file with over 2000 lines that I need to parse. I want to make sure I get 100% accurate results, which will then be imported to my MariaDB.
The file looks like this:
line 0: #start#
line 1: 20111211\200000
line 2: n=john|l=smith,131_stree_apt#102_city_state_11111_country,19989989988|17771112222,user%64domain.com,12,21,551|626|23\r
...
line 2156: #end#
so line 1 is the date time in 24h format line 2 is the line format:
- n = name
- l = last name
- full address
- phone + cell phone
- total goals
- total passes
- time on ice + time on bench
- penality minutes
I can't figure out the regular expression. My other idea was to parse each line and then parse each comma, then each pipe, etc., but I think this approach is slow and less accurate then regex. Am I right?