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 8303449
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T17:32:45+00:00 2026-06-08T17:32:45+00:00

Right now I am working with a text file that happens to have all

  • 0

Right now I am working with a text file that happens to have all the data next to each other like in the following string: AB005103012ES-** OF**MID115748607.83

However, I need to upload this to a MYSQL database, so ideally the translated format would have the code be separated with commas like so:

AB00,51,0301,2,ES-**,  ,O,F,**,M,I,D,1,157486,07.83

I am dealing with around 14 million lines and the commas would appear in the same character spot each time. As in the first comma would appear after the 4th character in each line, the second comma would appear after the 6th comma in each line and so on.

Is there any way to quickly achieve this in MYSQL or failing that, another simple program that could be run easily?

  • 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-06-08T17:32:47+00:00Added an answer on June 8, 2026 at 5:32 pm

    You can use INFILE along with the SUBSTR (substring) command.

    http://dev.mysql.com/doc/refman/5.1/en/load-data.html

    To load a text file with fixed width columns, I used the form:

    LOAD DATA LOCAL INFILE '<file name>' INTO TABLE <table>
    (@var1)
    SET Date=str_to_date(SUBSTR(@var1,3,10),'%m/%d/%Y'), 
    Time=SUBSTR(@var1,14,8), 
    WindVelocity=SUBSTR(@var1,26,5),
    WindDirection=SUBSTR(@var1,33,3),
    WindCompass=SUBSTR(@var1,38,3),
    WindNorth=SUBSTR(@var1,43,6),
    WindEast=SUBSTR(@var1,51,6),
    WindSamples=SUBSTR(@var1,61,4);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am working on a CSS file that is a total mess right now
I'm probably doing this all wrong. I have a text file full of data
Right now I am working on one Real Estate Website, In that website I
Right now I'm working on a program that throws up a bunch of separate
Im working right now on a program that can divide, add, ect, but, im
It doesn't seem to be working right now. I get a java.lang.NullPointerException I have
I have created some tests in my WPF application. Right now I am working
I have a tough problem right now. I am having a big dictionary file
I'm working on an encryption application that for now encrypts text-only files. I need
I am working on an app right now that is supposed to generate a

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.