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];
   }
  ]
 ]
POSTED BY: Tsai Ming-Chou
4 Replies

Thank you very much for your demonstration. I will follow this idea to practice.

POSTED BY: Tsai Ming-Chou
POSTED BY: Neil Singer
POSTED BY: Tsai Ming-Chou
Attachments:
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard