- What release?
- How was original file created?
dlmwrite error: Skipping lines, adding garbage values
2 views (last 30 days)
Show older comments
Kosha Dholakia
on 20 Mar 2015
Commented: Image Analyst
on 23 Mar 2015
I have a 455x39 array that I need to append to a text file. When I'm using dlmwrite,
dlmwrite(fileName, arrayName,'delimiter',\t,'-append');
it gives me 454 rows, with an additional garbage row above it. If I use the same command to write this array to a new file, it works correctly. What is going wrong?
4 Comments
Image Analyst
on 23 Mar 2015
The way I suggested works just fine - I tried it several times. You must have used it improperly. If you still want to use the dlmwrite() method or want to know what the error message was about, then give your code for it.
Accepted Answer
Image Analyst
on 20 Mar 2015
This works fine for me
arrayName = randi(9, 455, 39);
dlmwrite('deleteme.txt', arrayName, 'delimiter','\t','-append');
though I did have to add single quotes around your \t. I ran it twice and there is no garbage row at line 456, between the two sets of data.
0 Comments
More Answers (0)
See Also
Categories
Find more on Data Import and Export 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!