Hi all,
After I list the file names of a directory (Filenames[ ]) I would like tu use the file names as a variable (without the extension) . How do I do this?
For example:
In[18]:= SetDirectory["C:\\Users\\AG\\Google Drive\\Diploma cuccok\\remesh34\\D0_res"]
Out[18]= C:\Users\AG\Google Drive\Diploma cuccok\remesh34\D0_res
In[19]:= Fnames=TableForm[FileNames[]]
Out[19]//TableForm= m_inlet_rm34n_d0_stac_s0.out
m_intwin_rm34n_d0_stac_s0.out
m_outlet_rm34n_d0_stac_s0.out
point130_rm34n_d0_stac_s0.out
point131_rm34n_d0_stac_s0.out
point132_rm34n_d0_stac_s0.out
In[20]:= StringJoin[StringSplit[FileBaseName[Fnames[[1,1]]],"_"]]
Out[20]= minletrm34nd0stacs0
In[21]:= StringJoin[StringSplit[FileBaseName[Fnames[[1,1]]],"_"]]=Import[Fnames[[1, 1]], "Table"];
dl1 = Length[Data01]
During evaluation of In[21]:= Set::write: Tag StringJoin in StringJoin[{m,inlet,rm34n,d0,stac,s0}] is Protected. >>
Out[22]= 0
I would like to use "minletrm34nd0stacs0" as a variable name. This file "mintwinrm34nd0stac_s0.out" contains strings and numbers also. Only the first 3 row contains the string characters, but I do not need them, just the number rows.
In a bigger view, I would like to automatize the reading of the result files.