Converting Horizontal to Vertical, CSV dumps too?

J

JNation Rocks!

I've got a unique issue. Someone sent me a spreadsheet that I'm trying
to put into a database (mysql) and i figured i could import it as a
csv file into mysql. But instead of them putting in data vertically
with the entries going down the numbers, they did it horizontally. To
explain, they did:

HORIZONTAL

Name John David
Tel 12345 45677
Zip 10001 10002

instead of VERTICAL

Name Tel Zip
John 12345 10001
David 45677 10002


So now I don't know if excel will handle all the records or could be
exported into a csv file properly. Vertical will list records properly
in a csv file, e.g.
1, John, 12345, 10001
2, David, 45677, 10002

But doing a csv dump with #2 will yield
1, John, David
2, 12345, 45677
3,10001, 10002

So what can I do to correct this? As the data is in cells, I'm
thinking there is some function that should be able to fix this...
 
N

Niek Otten

It depends on the number of records.
If there aren't too many (or if you happen to have Excel2007), you can copy the data and then Paste Special and check Transpose.

--
Kind regards,

Niek Otten
Microsoft MVP - Excel


| I've got a unique issue. Someone sent me a spreadsheet that I'm trying
| to put into a database (mysql) and i figured i could import it as a
| csv file into mysql. But instead of them putting in data vertically
| with the entries going down the numbers, they did it horizontally. To
| explain, they did:
|
| HORIZONTAL
|
| Name John David
| Tel 12345 45677
| Zip 10001 10002
|
| instead of VERTICAL
|
| Name Tel Zip
| John 12345 10001
| David 45677 10002
|
|
| So now I don't know if excel will handle all the records or could be
| exported into a csv file properly. Vertical will list records properly
| in a csv file, e.g.
| 1, John, 12345, 10001
| 2, David, 45677, 10002
|
| But doing a csv dump with #2 will yield
| 1, John, David
| 2, 12345, 45677
| 3,10001, 10002
|
| So what can I do to correct this? As the data is in cells, I'm
| thinking there is some function that should be able to fix this...
|
|
 
V

Vergel Adriano

1. Select the entire range of your horizontal data.
2. Press CTRL-C to copy.
3. Go to another worksheet in your workbook.
4. Edit->Paste Special and make sure you check the "Transpose" check box.

Now you have your data in the VERTICAL format and do your CSV dump.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top