Choose specific rows from txt files

Hello,
I work on the below sample of a txt file:
STOCK DATE TIME PRICE VOLUME
ETE 04/01/2010 10145959 18.31 500 Big Cap
ALPPHA 04/01/2010 10150000 18.01 70 Big Cap
ETE 04/01/2010 10170000 18.54 430 Big Cap
ABC 04/01/2010 10190000 18.34 200 Big Cap
%How can I choose to keep specific columns by STOCK (column 1). To keep only rows for ETE for instance?
% And how can I keep only rows for specific values of lets say column 3 TIME ( say exclude values from 10140000-10161000, or keep 10170000-10180000) , and extract them to a new txt file?
Many thanks in advance,
Panos

回答 (1 件)

Chirag Gupta
Chirag Gupta 2011 年 4 月 19 日

0 投票

You should be able to do most of it using textscan smartly.
Use textscan to read/extract data out and then output it in your desired format using fprintf.

カテゴリ

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

質問済み:

Pap
2011 年 4 月 19 日

Community Treasure Hunt

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

Start Hunting!

Translated by