Re: dealing with many data file (importing and manupilation)



On 16 Mar, 22:16, "tatrek naser" <tknaser9...@xxxxxxxxxxx> wrote:
Hi guys,
I need help in making a code for importing and manupliating the data
from many files. for example i have over 100 data files showld be
read and the data will be extracted from them. The following code
just an example for importing data from specific file.
R14_00=importdata ('F:/data/SORA01_01000_200605_PM25');
pm25=R14_00.data(:,3:26);
my question is how to make it for all files without repeating such
lines for each one.

If all files are contained in one directory, try

FileList = dir('F:/data/');

From there on, find the file names by looping over the
data in FileList.

The one possily troublesome issue from your example is
to extract the variable name pm25 from the file name.
It *can* be done by string manipulations to extract the
part of the file name, and then EVAL, but the more
seasoned matlab programmers consistently advice against
that particular solution.

Before getting into alternatives, is my assumption
correct in that the variable name pm25 is derived
from the latter part of the file name?

Rune

.



Relevant Pages

  • Re: dealing with many data file (importing and manupilation)
    ... my question is how to make it for all files without repeating ... The one possily troublesome issue from your example is ... to extract the variable name pm25 from the file name. ... It *can* be done by string manipulations to extract the ...
    (comp.soft-sys.matlab)
  • Re: Shortcut creation changed -what did I do?
    ... I'm able to extract the .REG file, and can merge the contents to the ... Perhaps you can try opening Regedit.exe and try importing the REG ...
    (microsoft.public.windowsxp.configuration_manage)
  • Re: Session Variable in DTS
    ... Do you want to extract this column value from the file? ... i am using SQL server 2005, can i use a session variable in DTS package. ... i am importing a Text file, i have a field in the database ...
    (microsoft.public.sqlserver.dts)
  • Re: Import data between tables
    ... You can link to the other DB and then use a query to extract the data into a ... > Somehow one of my databases has gotten corrupted.I need to import data ... > have tried importing the tables but errors continue....i then need some ...
    (microsoft.public.access.externaldata)
  • Re: OT: Dumb computer question
    ... I have yet to figure out how to extract them. ... importing into the new computer (I know this would apply to outlook ... but not sure about other email applications). ... but hope others can chime in here. ...
    (rec.music.makers.guitar.acoustic)