Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

7
  • 1
    $\begingroup$ The replacement is not used at all (as the left hand side of the rule does not match anything in the list), though WhitespaceCleaning@a is evaluated before any replacement is done, and its argument is not a string, so an error message is issued. Try RuleDelayed (:>) instead of simply using Rule (->). $\endgroup$ Commented Jun 26, 2012 at 19:48
  • $\begingroup$ @IstvánZachar: I replaced -> with :>. Works now on Windows. However, both -> and :> return the same result on my Mac. I don't understand why "the left hand side of the rule does not match anything in the list". In ImportData I have two lists which do match the pattern {a_, b_, cc_, d_, e_, f_, g_, h_, i_}. $\endgroup$ Commented Jun 26, 2012 at 19:57
  • $\begingroup$ Sorry, my mistake: it does match. Do you load any custom packages on your Mac? Did you make sure no previous garbage is left in the kernel? Better run on both machines with a fresh kernel. $\endgroup$ Commented Jun 26, 2012 at 20:03
  • $\begingroup$ @IstvánZachar No problem. I did not load any custom packages and I run the code with fresh kernel on both systems. Problem remains. $\endgroup$ Commented Jun 26, 2012 at 20:06
  • 1
    $\begingroup$ Note that you can use StringTrim for your whitespace cleaning: reference.wolfram.com/mathematica/ref/StringTrim.html $\endgroup$ Commented Jun 26, 2012 at 22:22