Great community. Great ideas.
Welcome to ASP/Free, a community dedicated to helping beginners and professionals alike in improving their knowledge of Microsoft's development and administration technologies. Sign up today to gain access to the combined insight of tens of thousands of members.
December 3rd, 2012, 10:33 AM
Adding text to a file using VBA
I have some code that exports a table as a .csv file (running an append query to move selected records to a temp table then using DoCmd.TransferText).
I want to add a line of text at the start of the file.
One way I think I could do it is by using FileSystemObject to read the entire file and write it to a new file, but with a new line at the top. I don't want to do this as it seems like a very inefficient method - particularly as the .csv may be many thousands of lines.
I originally 'solved' the problem by having an append query add a line of text to the first field in the table before the main query runs. I thought this was a great idea until I realised that the line would also contain commas for each blank field afterwards, which is a problem.
Is there a better way of doing it?
Last edited by Charlie_B; December 3rd, 2012 at 10:36 AM.
February 2nd, 2013, 05:53 AM
Here's a simple explanation on how to read data from and write data to text file in asp.net How to read data from and write data to text file in Asp.Net | Free Dotnet Applications
By micky in forum .NET Development
Last Post: November 23rd, 2006, 09:28 AM
By elenton in forum ASP Development
Last Post: June 6th, 2005, 03:43 AM
By NoNerd in forum ASP Development
Last Post: May 4th, 2005, 09:37 AM
By RoofusX in forum Microsoft Access Help
Last Post: November 4th, 2004, 12:51 PM
By Steve Schofield in forum ASP Development
Last Post: January 24th, 2002, 01:18 PM