Azzera filtri
Azzera filtri

The correct way of importing data from a specific format

2 visualizzazioni (ultimi 30 giorni)
Hello all,
In my project I have a set of files with a specific format (.acs). I saved the files as .txt format, (because I couldn't find a better way) and then imported them by importdata function. But I can see that the imported data is different from the original .acs files. (I'm almost sure that its because I copied the files from .acs to .txt, and its why it's not working properly.)
So, what is the correct way to import data from a specific format like the one in my project?
  1 Commento
Negar
Negar il 19 Dic 2014
I tried to use load, but the files include a special character at the header (#) that makes the load impossible to work (the columns are not of equal length, because of that character). So, is there any way to get read of that character? I tried the load after removing that character manually and it works, but its not easy to remove for 1340 files! Any suggestion appreciated!

Accedi per commentare.

Risposta accettata

Orion
Orion il 19 Dic 2014
I don't know this .acs extension, but if it just contains some text, you can use textscan :
fid = fopen('YourFilePath.acs');
AcsContent = textscan(fid,'%s','delimiter','\n');
fclose(fid);
% see the content in the command window
AcsContent{:}

Più risposte (0)

Categorie

Scopri di più su Large Files and Big Data in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by