Solved

excel column of data export format

Posted on 2014-09-03
5
267 Views
Last Modified: 2014-09-22
Is there any possible to way to achieve the following.

I have an excel spreadsheet with a single column of data (in column A), the values are text/numerical, e.g. E45678, F45679. I need a way to export all the values to a text file into the following format:

('first cell of data', 'second cell of data', third cell of data')

ready for importing into a where clause on an external RDBMS. Is this possible? I know there is concatenate but with upwards of several hundred entries it would take an age to write such a formula, I need something more automated.
0
Comment
Question by:pma111
5 Comments
 
LVL 39

Expert Comment

by:als315
ID: 40301842
Can you upload sample? Both files: excel source and text file with result.
0
 
LVL 9

Assisted Solution

by:dipersp
dipersp earned 250 total points
ID: 40301845
If I'm reading what you're saying correctly - no formula needed.  I don't know how many cells this can handle, but what you can do is -

Highlight all data in column A (Can't select the entire column)
Copy
Move to cell B1.
Hit the drop down arrow in the PASTE button in the top toolbar and select SPECIAL PASTE.  Check the box for TRANSPOSE.   OK it and you're done.  

Clean up column A.

Now just export to whatever format you need.

Again, not sure this will handle hundreds - have to test it.
0
 
LVL 27

Accepted Solution

by:
Glenn Ray earned 250 total points
ID: 40301888
The fastest - not prettiest - way would be to set up a helper column with a couple of formulas:

If your data is in column A, starting in cell A1
Cell B1: =A1
Cell B2: =B1&","&A2

Copy down the formula in cell B2 as far down as your data in column A.  The last cell will have a full comma-delimited string composed of all values in A.  Note that you may not see all values displayed in the cell, but if you copy the last value into a notepad file, you'll see the whole string.

Example file attached.

Regards,
-Glenn
EE-Q28510838.xlsx
0
 
LVL 27

Expert Comment

by:Glenn Ray
ID: 40301895
PS  If you need the values bound by apostrophes:

B1:  ="'"&A1&"'"
B2: =B1&","&"'"&A2&"'" (copied down)

-Glenn
0
 
LVL 7

Expert Comment

by:tomfarrar
ID: 40304133
If I understand the question, Glen Ray has it the "nail on the head".  I have used that formula many times.
0

Featured Post

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

In case Office 2010 has not been deployed in your environment, this article may be quite useful. In our office, we wanted a way to deploy Microsoft Office Professional Plus 2010 through an automated batch file via logon script. This article is docum…
This code takes an Excel list of URL’s and adds a header titled “URL List”. It then searches through all URL’s in column “A”, looking for duplicates. When a duplicate is found, it is moved to the top of the list. The duplicate URL’s are then highlig…
The viewer will learn how to create two correlated normally distributed random variables in Excel, use a normal distribution to simulate the return on different levels of investment in each of the two funds over a period of ten years, and, create a …
This Micro Tutorial will demonstrate how to use longer labels with horizontal bar charts instead of the vertical column chart.

708 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now