Loading every n-th column of a csv with varying formats in row using textscan
Show older comments
Hi, i am trying to load a csv file with semicolon (;) delimiter.
Example:
150501;190722;ms_since_start=;30001276;temp=;31.97;IT=;147753;spec num=;1000;(here i have 512 floating number repetitions and ';;' to indicate the end of line)
this pattern repeats for 1000 rows.
I have been trying to use textscan but only get empty cells with the following code
formatSpec = ['%s%s%*s%*s%*s%*s%*s%*s%*s%*s%*s' repmat('%f', [1,512]) '%*[^;;]']
M = textscan(dirtmp, formatSpec, 'Delimiter', ';')
The goal is to get the first 2 columns, skip 9, get the remaining 512 columns and repeat this for 1000 rows.
Any help is highly appreciated
Accepted Answer
More Answers (0)
Categories
Find more on Spreadsheets in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!