another import from textfile question
Show older comments
dear ladies and gentlemen
of course this frequently occuring questions about data insertion are very annoying to you, i can understand that, but have to put my issue in here... =(
i have a textfile with maaaaaaaaany columns (2 rows and 13000 columns). its generated from a labview program. unfortunately i am not able to code a formatspec for that amount of columns. so cannot manage to make the data import working.
until now, i refered to https://de.mathworks.com/help/matlab/import_export/ways-to-import-text-files.html and the doc help library
the data in my text.file look like this. actually they are seperated by \t ...

but e.q. a .....
filename = 'S:\...\M0905_PK6.txt';
delimiterIn = '\t';
M = importdata(filename, delimiterIn);
...only creates a 2x1 cell where all values are consequentivly written in one cell per row ..

if i'm trying things like that....
...
[A,count] = fscanf(fileID, '%f %f');
...
..how can i handle the formatspec of so many columns.
of course i could transform (transpose, what is my original intention) those files manually with notepad++ e.q. per search and replace but i wanted to script it, maybe additional with a file location prompt later
i'm sending the original file and txtfile enclosed
can someone give me a hint =) ?
kindly regards
Basti
Accepted Answer
More Answers (1)
Guillaume
on 24 Jan 2019
Your file is a simple tab delimited file that is trivially read by csvread or dlmread or readtable:
M = csvread('M0905_PK6.txt')
Categories
Find more on Text Data Preparation 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!
