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

回答 (1 件)

Steve Eddins
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.

カテゴリ

Help Center および File ExchangeText Files についてさらに検索

製品


リリース

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by