N
N
Noob_0012015-07-07 11:27:28
SQL Server
Noob_001, 2015-07-07 11:27:28

What if the header is formed from the first line of the file?

Hello to all readers.
So the question is:
/* uploaded to the link server*/
exec sp_addlinkedserver
@server = 'csv',
@provider = 'MSDASQL',
@srvproduct = '',
@provstr = 'Driver={Microsoft Text Driver (*.txt; * .csv)};DefaultDir=C:\Job\;'
/*read file*/
select * from openquery (csv,'select top 1 * from [1.txt]') csv;
As a result, the first line of the file ... becomes the header.
To be treated by inserting an empty line at the beginning of the file.
Maybe someone knows a parameter or a trick that would not take the title?
Or a Bat file that will run through the entire folder and add an empty line (enter) to the beginning of the file in each txt

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question