Group Abstract Group Abstract

Message Boards Message Boards

Quickly clean up missing values from hundreds of XLS files?

I have hundreds of XLS files that need to be aggregated, but I find that each file has more or less missing values or error messages. Is there any way to quickly clean up these missing values or error messages? Because I still don't know how to clean up a lot of data, so the following code only extract the data in different files.

(*   Get a list of files   *)
dir = "D:\\Data";
fileList = FileNames["*", dir];
For[i = 1, i = Length[fileList], i++,
 If[i == 1,
      rawdata = Import[fileList[[i]], {"XLS", "Data"}][[1]];    (*i=1 olny *)
     ,
  {
   tempData = Rest@Import[fileList[[i]], {"XLS", "Data"}][[1]];        (*i != 1*)
   rawdata = AppendTo[rawdata, tempData];
   }
  ]
 ]
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard
Be respectful. Review our Community Guidelines to understand your role and responsibilities. Community Terms of Use