Select data from CSV file based on character in position, then read that character and next 2 character, of different read that character and next 3
3 ビュー (過去 30 日間)
古いコメントを表示
Hi,
Sorry its probably very easilily sorted but im only just starting with mathlab and I am unsure how to do this.
So, I have a CSV file of data i am trying to capture certain elements, Flow rate/Time.
The flow rates change from 1.XX to 0.1XX. So for the 1.XX there are a total of 3 values i need to capture and for 0.1XX there are 4.
If i had 1.XX take 4 characters then it would return 1.XX; as it would include the comma thatdelineates the data in the CSV.
I already have the Time by capturing the first 19 characters,
I can capture the flow rate by selecting characters 21-26 but some of these obviously contain the ; which i dont want.
Again apologies its probably very easy to somoone who knows what they are doing
Thanks
0 件のコメント
回答 (1 件)
Steve Eddins
2020 年 11 月 23 日
MATLAB has a number of functions that can automatically read and parse CSV files and return the results in a useful form. Try readtable, readtimetable, readmatrix, and readcell.
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Text Files についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!