could you please help me upload dat file without header, also I would like to get similar arrangement of data, as you see there is some rows have extra columns
thanks
Best Answer
Since you have not attached any sample file, I am giving you an example with a attached file.
You should run your loop from 1 to length(fileinfo) . For whatever reason, dir() is only returning 17770 file names. Code that assumes a particular number of names in a directory is likely to crash eventually.
You should focus your efforts on figuring out why dir() is returning 17770 file names instead of the number you expect. For example the rest of the 50000 might not be *.txt files. Or perhaps there is a bug: I do not recall which MATLAB release you are using?
Best Answer