Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6922437
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T10:24:21+00:00 2026-05-27T10:24:21+00:00

I have a file with over 2000 lines that I need to parse. I

  • 0

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
  • email
  • 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?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T10:24:22+00:00Added an answer on May 27, 2026 at 10:24 am

    i can’t figure out the regular expression so my idea was to parse each line and then parse each comma, then each pipe then …. which i think is slow and less accurate then regexp

    Why don’t you go and try it out?
    Don’t let this intimedate you, be bold.
    In general, I’d do the following if I were you:

    1. Make a straightforward implementation
    2. Test it
    3. Tune it

    ~2000 records is not so much, so the third step might not even be required (in particular if this is a migration that only runs once — so what if it takes 2 minutes?).

    BTW: This is general programming advice and does apply to a lot of problems. Don’t optimize prematurely.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a tab-delimited file that has over 200 million lines. What's the fastest
I have a bash file that contains wget commands to download over 100,000 files
I have a text file that I want to send over the network, this
I have a DotNetNuke skin that has a single CSS file over 3,500 lines
I have a file that has over 200 lines in this format: name old_id
Say I want to have a server that can accept 2GB file over network,
I have a a large text file (over 70mb) and need to count the
I have a PHP client that requests an XML file over HTTP (i.e. loads
I'm currently implementing a client application that POST's a file over HTTP and have
I have a file with a little over a million lines. {<uri::rdfserver#null> <uri::d41d8cd98f00b204e9800998ecf8427e> <uri::TickerDailyPriceVolume>

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.