Add data at top of text file

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



I have a text file (CSV) formatted for upload using an FTP tool; but I need
to add a certain header to the top of the text file, before the contents.
Because this will be done often and the exacting requirements of FTP, I am
coding this procedure using VBA.

Can someone please provide a generic example showing how to open the file
for editing, insert a header, save, and close the text file?

I am familiar with both the "Open for Input/Output" method and also the
"FileSystemObject" methods. I've appended data before, but I'm not sure how
to insert info at the top of the file. Your help would be much appreciated.
.



Relevant Pages

  • RE: CSV Header Information
    ... I thought you said you want to write/create a csv file with your data in it, ... adding hour header at the top. ... Dim ColNdx As Integer ... "Tom Ogilvy" wrote: ...
    (microsoft.public.excel.programming)
  • Re: Adding Header to CSV
    ... file with the path and CSV file name. ... .TextFilePromptOnRefresh = False ... insert a row at A:A and enter your header and formatting etc. ... Opens the CSV file. ...
    (microsoft.public.excel.programming)
  • Re: How to sort by a field name?
    ... CSV "standards" is the ability to have a header row. ... The point is just that since there's no one CSV standard the statement that any tool does or doesn't handle CSV is pretty meaningless - you've got to say which CSV "standard" a given tool handles, ... I wasn't suggesting any of those tools should be made to handle any of the common CSV standards, anyway, though - just pointing out that they address the main, common concept. ...
    (comp.unix.shell)
  • Re: Adding Header to CSV
    ... App_WorkbookOpen event if the file is a CSV. ... insert a row at A:A and enter your header and formatting etc. ... Opens the CSV file. ... "The only dumb question is a question left unasked." ...
    (microsoft.public.excel.programming)
  • Re: CSV with Ruby Newbie
    ... def process(header, row) ... CSV:: to get it to work. ... can't see header as being a CSV module either. ... "Some CSV files have a header line. ...
    (comp.lang.ruby)