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
조회 수: 12 (최근 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!