How can I add a line return to an uploaded text file?

I've uploaded a large .txt file containing the directories of all files of a desired file type. In the .txt file, every directory is on its own line. Once uploaded to Matlab however, the line returns are missing and I am left with a matrix of 1x2621385 char.

4 comentarios

What function are you using to read it into your MATLAB workspace?
Posting the code you use would be helpful.
Zeke Merchant
Zeke Merchant el 8 de Jul. de 2014
Editada: Zeke Merchant el 8 de Jul. de 2014
I used fopen and then fscanf.
fileID=fopen('master_inventory.txt');
inventory=fscanf(fileID, '%c');
Try:
inventory= textscan(fileID,'%s %*[^\n]');
inventory = inventory{1};
Worked wonderfully, THANK YOU!!!

Respuestas (0)

La pregunta está cerrada.

Productos

Etiquetas

Preguntada:

el 8 de Jul. de 2014

Cerrada:

el 20 de Ag. de 2021

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by