PC Review


Reply
Thread Tools Rate Thread

How can I overwrite the last line data in text or csv file from VB

 
 
Jennifer
Guest
Posts: n/a
 
      19th Apr 2010
Hello,

Is there a method that I can overwrite the last line of csv/text file
WITHOUT reading the whole file from the first line from Excel VBA ?

I am trying to read the last line of data and use if function to determine
if it would be overwritten. Besides reading the whole file in and rewriting
all of them out, is there another efficient way to handle it?

 
Reply With Quote
 
 
 
 
Gary Brown
Guest
Posts: n/a
 
      20th Apr 2010
You can read the whole file but only remember the last line so you're not
using up lots of memory.
This only remembers the last record read...
Do While Not EOF(iFileNum)
Input #iFileNum, strEachRecord
strLastLine = strEachRecord
Loop

--
Hope this helps.
If it does, please click the Yes button.
Thanks in advance for your feedback.
Gary Brown



"Jennifer" wrote:

> Hello,
>
> Is there a method that I can overwrite the last line of csv/text file
> WITHOUT reading the whole file from the first line from Excel VBA ?
>
> I am trying to read the last line of data and use if function to determine
> if it would be overwritten. Besides reading the whole file in and rewriting
> all of them out, is there another efficient way to handle it?
>

 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to overwrite data in file? Joe User Microsoft Excel Programming 0 10th Dec 2009 10:28 PM
Transfer Text won't overwrite existing file Microsoft Access Macros 2 1st Nov 2008 06:58 PM
OverWrite a line of text? Eric B. Microsoft C# .NET 2 16th Oct 2008 10:15 PM
Parsing Data String from text file line gtslabs Microsoft Excel Programming 1 21st Apr 2007 08:13 PM
Line up Output data in a text file? =?Utf-8?B?U2hhbmU=?= Microsoft Access VBA Modules 3 8th Apr 2005 09:16 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 03:23 PM.