Solved

export mysql data into multiple rows in excel

Posted on 2013-11-04
4
324 Views
Last Modified: 2013-12-04
I have a plugin in wordpress that sets up addresses for a google map.

I'd like to export the data into separate columns in Excel.  My first attempt didn't work as it puts everything into 1 column in Excel.

I can get the information exported out of phpMyAdmin correctly, but need to split what's exported into name, address, city, state, zip.

Here's how it exports

"310 E. Argonne Dr
Kirkwood, MO 63122
Mail to:  PO Box 515134
314-984-9224
Pastor: Thomas Lovis"

Is there something I'm missing on the export or a tool in Excel that I'm overlooking?  I tried data to columns but it only grabbed the address.
0
Comment
Question by:axessJosh
  • 2
  • 2
4 Comments
 
LVL 12

Expert Comment

by:Harry Lee
ID: 39622722
axessJosh,

When you export from phpMyAdmin, did you setup the export options?

Fields terminated by  ,
Fields enclosed by    "
Fields escaped by     \
Lines terminated by   AUTO
Replace NULL by       NULL

Instead of using ,(Comma) in the Fields Terminated By, I usually use some Ascii symbols that does not normally exist in the data. For example, ¤ (Alt-1231). That way, when I open the CSV somewhere else, I can delimit it with ¤ instead of comma. That way, there is no field mix.
0
 
LVL 2

Author Comment

by:axessJosh
ID: 39622790
I didn't set any export options.  I wasn't sure there was rhyme or reason to how the fields were saved in the DB and didn't know there were options like that.

I'll look at re-exporting with those changes.
0
 
LVL 2

Author Comment

by:axessJosh
ID: 39628492
I can see where that will work, but when I tried, all the info is contained into one cell in the DB.  I can't see where there's anything to select in the "text to columns" wizard that'll let me distinguish where to separate.
0
 
LVL 12

Accepted Solution

by:
Harry Lee earned 500 total points
ID: 39631790
axessJosh,

In your new export do you see the Fields termination symbols in the data?

If you do, you can now separate the data into column by doing Text-To-Column in Excel.

1.

Highlight you data in Excel.

2.

Open up Text to Columns Wizard in Excel. Do that by going to Data Ribbon Menu, then Text to Columns.

3.

Select Delimited as the separation method and click next.

4.

In the Delimiters section, uncheck everything, then check Other:. In the provided text box, type in Fields Termination Symbol you have choose to use when you exported your data. As you type in the Field Termination Symbol, you should be able to see the separation line in the Data Preview Pane. Click Next to continue.

5.

This final step is optional. In this step, you can choose to assign different format to the data columns and you can also choose to not importing some of the columns. Make changes if needed and click Finish when done.
You should now have everything broken into columns for you.
0

Featured Post

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Creating and Managing Databases with phpMyAdmin in cPanel.
Some code to ensure data integrity when using macros within Excel. Also included code that helps secure your data within an Excel workbook.
Graphs within dashboards are meant to be dynamic, representing data from a period of time that will change each time the dashboard is updated with new data. Rather than update each graph to point to a different set within a static set of data, t…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

832 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question