Pasting an sql from notepad to a single cell in Excel

G

Guest

I need to copy and paste around 100 sql scripts from Notepad to Excel
Each SQL statement should copy into a single cell. However, a simple "copy and paste" does not paste the SQL as a grouping in one excel cell but instead splits the sql into separate row

eg
ACTUAL RESULT
*****************
EXCEL ROW 1: select c.legl_type_c, count(*
EXCEL ROW 2:from ptemp.cii_cust
EXCEL ROW 3:where cust_i < 4500000
EXCEL ROW 4:group by c.legl_type_c

DESIRED RESULT
*****************
EXCEL ROW 1: select c.legl_type_c, count(*
from ptemp.cii_cust
where cust_i < 4500000
group by c.legl_type_c

How can I paste the SQL scripts into a cell (like above)
Can this be done without coding

Much appreciated
Je
 
N

Nikos Yannacopoulos

Jem,

Once you've copied from Notepad, select the destination cell and press F2
(to go to Edit mode) , and then paste with Ctl+V.

HTH,
Nikos

Jem said:
I need to copy and paste around 100 sql scripts from Notepad to Excel.
Each SQL statement should copy into a single cell. However, a simple "copy
and paste" does not paste the SQL as a grouping in one excel cell but
instead splits the sql into separate rows
 
J

JMay

With your Actual Results now in A1:A4 - Go to cell B1 and enter:
=A1&A2&A3&A4 or Concatenate(A1,A2,A3,A4)
B1 will now contain what you want, however in formula form, SO!
Copy B1, and Paste-Special Value (to itself). Then you can erase A1:A4

Jem said:
I need to copy and paste around 100 sql scripts from Notepad to Excel.
Each SQL statement should copy into a single cell. However, a simple "copy
and paste" does not paste the SQL as a grouping in one excel cell but
instead splits the sql into separate rows
 

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