Problem extracting data from dos command.

I managed to obtain a string using
data = evalc('!netstat -s -p UDP')
However, when I tried to use sscanf, all I got was '' .
received = sscanf(data,'Datagrams Received = %d') received =
''
Did I do something wrong or did I miss a step? Or is there another method?

 採用された回答

Walter Roberson
Walter Roberson 2011 年 5 月 5 日

0 投票

sscanf does not look through the data until it finds something that matches the format: sscanf only succeeds if the part from the beginning of the string matches the format.
I suggest you look at regexp()

1 件のコメント

Andre
Andre 2011 年 5 月 6 日
It works. Thank you!

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

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeCharacters and Strings についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by