Solved

excel column of data export format

Posted on 2014-09-03
5
296 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 40

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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Outlook Free & Paid Tools
Some code to ensure data integrity when using macros within Excel. Also included code that helps secure your data within an Excel workbook.
This Micro Tutorial will demonstrate in Microsoft Excel how to add style and sexy appeal to horizontal bar charts.
This Micro Tutorial will demonstrate the scrolling table in Microsoft Excel using the INDEX function.

830 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