Solved

excel column of data export format

Posted on 2014-09-03
5
310 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Office 365 Training for IT Pros

Learn how to provision tenants, synchronize on-premise Active Directory, implement Single Sign-On, customize Office deployment, and protect your organization with eDiscovery and DLP policies.  Only from Platform Scholar.

Question has a verified solution.

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

Some code to ensure data integrity when using macros within Excel. Also included code that helps secure your data within an Excel workbook.
This article helps those who get the 0xc004d307 error when trying to rearm (reset the license) Office 2013 in a Virtual Desktop Infrastructure (VDI) and/or those trying to prep the master image for Microsoft Key Management (KMS) activation. (i.e.- C…
This Micro Tutorial will demonstrate in Microsoft Excel how to add style and sexy appeal to horizontal bar charts.
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

734 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