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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T12:30:48+00:00 2026-05-29T12:30:48+00:00

I will given an Excel sheet with many records(more than 1000 records). I have

  • 0

I will given an Excel sheet with many records(more than 1000 records).

I have to upload few fields of this excel sheet into Mysql. For each record a unique id will be assigned using an auto increment field in Mysql.

Now i have to create a single XML file for the Excel sheet along with the unique id assigned in Mysql table.

Is there a way i can automate the process or what will be a simplest way to do it?

  • 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-29T12:30:49+00:00Added an answer on May 29, 2026 at 12:30 pm

    Automation will be somewhat limited because you need to validate the input against your business rules. Some fields are required, formatting may be important for some and the allowed entries may have a constrained list. You can just shove the data in, but it will break on invalid entries. That is probably not acceptable.

    If the following is helpful, I have a PHP function that I wrote that makes it easy to convert a delimited upload file (tabs in the example) into an array keyed to the column names. Once you have this you can iterate the data structure to do validation and do inserts. For very large data sets a LOAD DATA MySQL command will be more performant though.

      function buildUploadArray($File) 
      {
        $handle = fopen($File, "r");
        $fields = fgetcsv($handle, 1000, "\t");
    
        while($data = fgetcsv($handle, 1000, "\t")) 
        {
          $detail[] = $data;
        }
    
        $x = 0;
        $y = 0;
    
        foreach($detail as $i) 
        {
          foreach($fields as $z) 
          {
            $result[$x][trim(strtolower($z))] = trim($i[$y]);
            $y++;
          }
          $y = 0;
          $x++;
        }
    
        return $result;
      }
    

    This does mean that your users upload a tab-delimited file instead of Excel, but it is easy for them to save in that format. You can likely use the http://phpexcel.codeplex.com/ if you need the upload format to be Excel.

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

Sidebar

Related Questions

I have an app, and the username field will convert any given value to
We have an Excel file with a worksheet containing people records. 1. Phone Number
I have been given a task to create a Python file that will take
I need code in java for Excel to XML conversion. where Excel sheet will
HI all , I have used a POI API and make excel sheet. I
I have some strings in Java (originally from an Excel sheet) that I presume
I have a "duration" column in an Excel sheet. Its cell format always changes
In an Excel sheet I will receive the data, which in turn I need
I won't know how much text will be given to display, and the JTextAreas
I am trying to write a reward system wherein users will be given reward

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.