|
In your script,
1) To read from data files in your folder ,use the dir command like this to get all filenames
f=dir('*.txt'); % when running this script in the same directory as the files or f= dir(<path to folder/*.txt');
2) f.name is a cell array of strings containing all the txt files.
3) Run a loop to access all files from f.name , do the analysis and save the results.
4) Cant your read the description string from the top of the file and write it to the results file use fprintf ?
"Alix " <preston@phys.ufl.edu> wrote in message <gu25ii$5hn$1@fred.mathworks.com>...
> I am trying to write a script that loads a .txt data file from a folder (say 1.txt), does some analysis on it, exports the variables I need to a file (say 1_a.txt), and then takes the next data file in the folder and does the same thing (although I want the next imported file, 2.txt, to have its variables saved as 2_a.txt) until all of the files have been analyzed without me having to load/save the the file each time. Is there an easy way to do this? I am just having problems with the importing/exporting part.
>
> Alt the top of these .txt files is a brief description of how the data was taken. I was also wondering if there was a way to keep this description when I save the variables.
|