Transpose data

K

kay ree

Hello there. I need some help. I would like to transpose
my data from rows to columns. Below is an example.

Field1 field2 field3
Name john
Address xxx1
ZipCode 12345
City atlanta
State ga
Name jane
Address xxx2
ZipCode 12345
City nashville
State tn
Name alex
Address xxx3
ZipCode 12345
City sacramento
State ca
Name daniel
Address xxx4
ZipCode 48945
City san diego
State ca

Instead of field1 field 2 and field3, I would like the
columns to be Name Address ZipCode City State and the data
that follows to go under the column headings-- the norm.
Any ideas on how to accomplish this? Thanks in advance!
 
T

Tim Ferguson

Instead of field1 field 2 and field3, I would like the
columns to be Name Address ZipCode City State and the data
that follows to go under the column headings-- the norm.
Any ideas on how to accomplish this? Thanks in advance!

I'm assuming this is a text file: if it's a normal table then you are in
big trouble because there is nothing to sort on and the different lines
will not end up in the records they started with. Assuming that to be the
case then, I'd use a text editor to :


Put in the column headings like this:
"Name", "Address", "Zipcode", "City", "State"

Replace each incident of 'Name' with a quote character;

Replace each incident of '\nAddress' with ", " (quote comma space quote)

Do the same for Zipcode and City

Replace each incident of '\nState' with just a quote (to close the last
column)

You should then have a plain CSV file, which you can import using normal
methods.

HTH


Tim F
 
T

Tim Ferguson

All
the data is in Access..

In that case, how do you know which City corresponds to which Name? There
is _no_ guarantee that records will always come back in the same order
unless you have a specific sorting order, and that was not in your original
post. I'd be tempted to export the whole lot into a text file and reorder
it there.

Best of luck



Tim F
 

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