Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Adding a header to a CSV file

Hi,

I have a number of CSV files I wish to query using ADO, the only
problem is there are no headers in the CSV files. The obvious option is
to open them in excel and manually enter the headers, howerver there
are more than 65536 records so this is not possible.

Does anyone have any good ideas? any help would be much appreciated.

Thanks,
Tom

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,391
Default Adding a header to a CSV file

If it only a few files that you need to change, NotePad/WordPad can open
these
Otherwise, you can import them into Access. Number of rows is not a concern
then.
Make you changes then export, if you need to keep the .csv format.

NickHK

"Tom Cameron" wrote in message
ups.com...
Hi,

I have a number of CSV files I wish to query using ADO, the only
problem is there are no headers in the CSV files. The obvious option is
to open them in excel and manually enter the headers, howerver there
are more than 65536 records so this is not possible.

Does anyone have any good ideas? any help would be much appreciated.

Thanks,
Tom



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,588
Default Adding a header to a CSV file

If you know what the headers should be then you could just construct your SQL using the default field names provided by ADO and
alias the names to the "correct" values...

Tim



"Tom Cameron" wrote in message ups.com...
Hi,

I have a number of CSV files I wish to query using ADO, the only
problem is there are no headers in the CSV files. The obvious option is
to open them in excel and manually enter the headers, howerver there
are more than 65536 records so this is not possible.

Does anyone have any good ideas? any help would be much appreciated.

Thanks,
Tom



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Adding a header to a CSV file

Do they all use the same layout?

If yes, create a file with that single header line.

Then shell to DOS and merge the files using an old DOS command.

Go to the folder that contains the .CSV files and header file and issue this
command:

copy Header.txt + somefile.csv somefileNEW.csv






Tom Cameron wrote:

Hi,

I have a number of CSV files I wish to query using ADO, the only
problem is there are no headers in the CSV files. The obvious option is
to open them in excel and manually enter the headers, howerver there
are more than 65536 records so this is not possible.

Does anyone have any good ideas? any help would be much appreciated.

Thanks,
Tom


--

Dave Peterson
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Adding a header to a CSV file

Thanks for you help everyone, I've used the default ADO headers to get
this to work.

Cheers,
Tom


Dave Peterson wrote:
Do they all use the same layout?

If yes, create a file with that single header line.

Then shell to DOS and merge the files using an old DOS command.

Go to the folder that contains the .CSV files and header file and issue this
command:

copy Header.txt + somefile.csv somefileNEW.csv






Tom Cameron wrote:

Hi,

I have a number of CSV files I wish to query using ADO, the only
problem is there are no headers in the CSV files. The obvious option is
to open them in excel and manually enter the headers, howerver there
are more than 65536 records so this is not possible.

Does anyone have any good ideas? any help would be much appreciated.

Thanks,
Tom


--

Dave Peterson


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Adding a formula to the header Michelle Excel Discussion (Misc queries) 5 January 5th 09 04:39 PM
adding cell reference on a header Sima Excel Worksheet Functions 4 March 29th 07 07:14 PM
email header on a file Fred Excel Discussion (Misc queries) 2 October 13th 06 08:18 PM
Please help with Adding a Footer or Header Al Excel Discussion (Misc queries) 3 August 14th 05 12:30 PM
Adding Header to multicolumn ListBox Wellie[_2_] Excel Programming 1 February 19th 04 10:31 AM


All times are GMT +1. The time now is 06:20 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"