Add a line to a text file

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello,
I need to add a line to a csv file through access (at the begining not the end of the file).
In Excel VBA I would have been using Print#
How can I do that in Access.
Many thanks.
R
 
You would use the Open Statement in combination with either the Print # or
Write # Statements in much the same way that would do it in Excel VBA. In
fact, the VBA Help files on these statements appear to be identical in Excel
and Access.

As to adding a line to the beginning of your csv file, AFAIK, the Windows
file system does not support "pre-pending" data into text files. The only
thing I could recommend is to create a new file, write your string, then
open the saved file and append each line from it into the new file you have
created. To do this, you would use the Open and Input # Statements, among
others. You can get more information on these statements in VBA Help.
 
As to adding a line to the beginning of your csv file, AFAIK, the Windows
file system does not support "pre-pending" data into text files.

c:\data > copy header.txt + body.txt wholefile.txt


There's life in that old dos yet. It's amazing how many simple things
Windows tries to make hard.

B Wishes


Tim F
 
Back
Top