Message Boards Message Boards

0
|
4835 Views
|
2 Replies
|
0 Total Likes
View groups...
Share
Share this post:

data manipulation with Loop

Hi, I have a table as result, but the first element the each "risult[[All,1]]" is two brackets empty. I would like delete it, with the command "drop" and a loop "for", or "do", because i have a lot of files.csv . But I can't. So, theses are my commands and files in attachment. I hope in your help!

SetDirectory[pathcast];
aa = FileNames["Cp*"];
risult = Table[Import[aa[[i]] ,"Table"],{i,1,2}]
For[i=1 ,i<3, i++, Drop[risult[[i,All]],1]]

Thanks

Margherita

Attachments:
2 Replies

Thanks!

SetDirectory[pathcast];
fileNames = FileNames["Cp*"];
result = Import[#, "Table"]& /@ fileNames;
resultDrop = Drop[#,1]& /@ result;

or

 SetDirectory[pathcast];
 result = Drop[#, 1]& /@ (Import[#, "Table"]& /@ FileNames["Cp*"]);
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract