So I wanted my app to scan a text file consistently... So that it will update according to what the file has soon as the file is in that specific directory. How is that possible?? Because I have no clue what is the function for that.

 採用された回答

per isakson
per isakson 2015 年 2 月 10 日
編集済み: per isakson 2015 年 2 月 10 日

3 投票

"soon as the file is in that specific directory" &nbsp See: Monitor Changes to .TXT File
Create a FileSystemWatcher object fileObj and watch the Changed event for files
with a .txt extension in the folder C:\work\temp.
fileObj = System.IO.FileSystemWatcher('c:\work\temp');
fileObj.Filter = '*.txt';
fileObj.EnableRaisingEvents = true;
addlistener(fileObj,'Changed',@eventhandlerChanged);
"scan a text file consistently" &nbsp what exactly do you want to do. Read the file and search for specific content?

1 件のコメント

Tamfor Dulin
Tamfor Dulin 2015 年 2 月 11 日
編集済み: Tamfor Dulin 2015 年 2 月 11 日
Thanks alot What you told me is exactly what I needed. I can do the rest...

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File Exchange で File Operations についてさらに検索

製品

タグ

質問済み:

2015 年 2 月 10 日

編集済み:

2015 年 2 月 11 日

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by