• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 181
  • Last Modified:

How could the VB process the text file created by matlab automatically?

i do the calculations by matlab and the results could be saved into text file
how could the vb detect the current changes of text file and load the file automically?
0
Fan
Asked:
Fan
1 Solution
 
tampabay420Commented:
maybe you could use the last modified value, Windows will store the date the last time a file was modified... or you could try matching the File Size, if the file is larger than it was before then new content has been added... etc...

hope this helps
0
 
aelatikCommented:
You could set up a timer and scan every (60 or whatever) seconds if the 'modification date' has changed or the file size. And if changed process the file..

It works for me ...

0
 
aelatikCommented:
Wow look at the post time ;-)
0
Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

 
aelatikCommented:
Test it...

Place a timer and a textbox on your form and test it...

Dim FirstTime As Boolean
Private Sub Form_Load()
FirstTime = False
Timer1.Interval = 1000 '1 second
End Sub
Private Sub Text1_Change()
If FirstTime = True Then
MsgBox Text1
End If
End Sub
Private Sub Timer1_Timer()
    Text1 = FileDateTime("c:\test.txt")
    FirstTime = True
End Sub
0
 
CleanupPingCommented:
Fan:
This old question needs to be finalized -- accept an answer, split points, or get a refund.  For information on your options, please click here-> http:/help/closing.jsp#1 
Experts: Post your closing recommendations!  Who deserves points here?
0
 
DanRollinsCommented:
Moderator, my recommended disposition is:

    Accept aelatik's comment(s) as an answer.

DanRollins -- EE database cleanup volunteer
0

Featured Post

[Webinar] Improve your customer journey

A positive customer journey is important in attracting and retaining business. To improve this experience, you can use Google Maps APIs to increase checkout conversions, boost user engagement, and optimize order fulfillment. Learn how in this webinar presented by Dito.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now