Tag Info

Hot answers tagged

18

Mathematica is interpreting c as a currency marker. This is controlled by the "CurrencyTokens" import option for "Table". The default setting for "CurrencyTokens" is {{"$ ", "£", "¥", "€"}, {"c ", "¢", "p ", "F "}} so this also happens with the letters p or F. The workaround is ImportString["123c", "Table", "CurrencyTokens" -> None] (* {{"123c"}} ...


8

(All observations made in version 7.) There seems to be a limitation for input even in the Front End (Notebook interface), in that if I enter more than 766 levels of nested lists I get a MaxFormatDepthExceeded expression and an error beep. The help text is: A box structure with a depth exceeding the maximum allowed depth was encountered. We can at ...


6

In Mathematica 10.0.0 for Windows, I have experienced similar problems. When non-ASCII characters were placed after \ in a string, they were decoded in a strange way. (Character '\' is used as a path separator in Windows). ToCharacterCode["\\a", "Unicode"](*OK*) {92, 97} ToCharacterCode["\\", "Unicode"](*OK*) {92} ToCharacterCode["μ", "Unicode"](*OK*) ...


5

What you experience here seems to be some kind of stack limit when you have nested expressions. It doesn't seem to matter whether you nest lists or function calls. Look for instance at this example here which is nothing more than a nested call f[f[f[...f[a]]..] On the other hand, if the parser doesn't need to build up such a large stack, it seems to ...


4

This is a good test set. I'm feeding this to the primary developer on SemanticImport, hopefully we can fix this for 10.0.1 (we've already improved SemanticImport a lot since the release branch).


3

I would use StringFreeQ: (* files = {"10.txt", "11.txt", . . ., "inelasticov3-8.txt", "inelasticov3-9.txt"}; *) Select[files, StringFreeQ[#, "inelastic"] &] {"10.txt", "11.txt", "12.txt", "13.txt", "14.txt", "15.txt", "16.txt", "17.txt", "18.txt", "19.txt", "1.txt", "20.txt", "2.txt", "3.txt", "4.txt", "5.txt", "6.txt", "7.txt", "8.txt", ...


2

This somewhat depends on your specific file names, desired target filename and location, the details of procedure etc. There would be a number of approaches. I post this for motivation. In the following I assume: all the files for processing are in the same directory (and number 0 Mod 5) they have a sequential nomenclature that will be preserved they are ...


2

To get the file list without the files containing "inelastic", you can use: Cases[{your file list here}, x_String /; StringMatchQ[x, "*inelastic*"] == False] Then, to import them: Import[#] & /@ % One-step solution: Import[#] & /@ Cases[{your file list here}, x_String /; StringMatchQ[x, "*inelastic*"] == False] Edit: Out of curiosity, ...


2

You need to use the pattern "*inelastic*.txt" in FileNames. This will only return the list of files you need. Then use Map with pure functions (Function) to import all of them in one go: Import[#, "Table"]& /@ fileNames or similar. To use everything except file names with "inelastic", you can use Select,Cases,DeleteCases, etc. withStringMatchQ`. ...


1

This is one workaround: csv = Import["https://docs.google.com/spreadsheet/pub?key=0Ati-pfGwn22sdGt1T3E4S3NFYWxmQXY2ZUJ0MmhXd2c&output=csv", "CSV"]; header = First[csv] data = Rest[csv]; Dataset[ AssociationThread[header -> #] & /@ data ]



Only top voted, non community-wiki answers of a minimum length are eligible