Blue1971
New Member
- Joined
- May 19, 2020
- Messages
- 15
- Office Version
- 2016
- Platform
- Windows
I have a .TXT text file that has formatted SQL queries in it.
I want to copy the text from a text editor and paste it into Column D in an Excel 365 spreadsheet.
Each query would be inserted into it's own cell/row. Like this:
Regarding the SQL comments in each query:
It would be ideal if the SQL comments were removed. But it's ok to leave them in if it's too hard or messy to get rid of them.
It would also be ideal if the SQL spacing were visible -- without the need to double-click a cell to see the proper spacing. But again, that's not necessary if it's not practical.
How can I paste the formatted SQL queries into Excel? (one Excel row for each query)
SQL:
--The corresponding Excel row ID is: 2
select
main.active_transportation.objectid,
main.active_transportation.type,
main.active_transportation_nt_flag_vw.objectid,
main.active_transportation_nt_flag_vw.flag
from
main.active_transportation
left outer join main.active_transportation_nt_flag_vw on
main.active_transportation.objectid = main.active_transportation_nt_flag_vw.objectid
where
main.active_transportation.objectid in ( 49996, 49997, 49998, ... );
--The corresponding Excel row ID is: 3
select
main.active_transportation.objectid,
main.active_transportation.type,
main.active_transportation_nt_flag_vw.objectid,
main.active_transportation_nt_flag_vw.flag
from
main.active_transportation
left outer join main.active_transportation_nt_flag_vw on
main.active_transportation.objectid = main.active_transportation_nt_flag_vw.objectid
where
main.active_transportation.objectid in ( 14113, 14114, 14115, ... );
--The corresponding Excel row ID is: 4
select
main.active_transportation.objectid,
main.active_transportation_nt_flag_vw.flag
from
main.active_transportation
left outer join main.active_transportation_nt_flag_vw on
main.active_transportation.objectid = main.active_transportation_nt_flag_vw.objectid
where
main.active_transportation.objectid in (54081, 54082, 54083, ...);
I want to copy the text from a text editor and paste it into Column D in an Excel 365 spreadsheet.
Each query would be inserted into it's own cell/row. Like this:
Regarding the SQL comments in each query:
SQL:
--The corresponding Excel row ID is: 2
It would be ideal if the SQL comments were removed. But it's ok to leave them in if it's too hard or messy to get rid of them.
It would also be ideal if the SQL spacing were visible -- without the need to double-click a cell to see the proper spacing. But again, that's not necessary if it's not practical.
How can I paste the formatted SQL queries into Excel? (one Excel row for each query)