New answers tagged

4

There are two differences between Write and WriteString: Write adds a newline after all expressions, WriteString does not. Write uses the FormatType of the output stream (default InputForm), WriteString uses OutputForm. WriteString does not require its argument to be a string. Therefore, the simplest fix is to just change the second Write to WriteString....


5

As commented by J. M. you can persistently increase the menu size with: SetOptions[$FrontEnd, "NotebooksMenuHistoryLength" -> 20] (* 20 is arbitrary *) You can extract a list of Notebook locations with: NotebooksMenu /. Options[$FrontEnd] // MapAt[ToFileName @@ #[[1, ;; 2]] &, {All, 2}]


2

a good use for the "new in 10" StringTemplate : Table[ StringTemplate["D:\\20160615\\20160615-`1`-`2`.asc"][i, j], {i, 3}, {j, 3}] incedentally, if you need to zero pad your numbers as they often occur in file names you can use this mess: Table[ StringTemplate[ "D:\\20160615\\20160615-<*TemplateExpression[IntegerString[`1`,10,2]]*>-`...


4

It seems that a simple modification of your code will work. fileList[prefix_String, m_Integer, n_Integer] := With[{dash = "-"}, prefix <> dash <> ToString[#] <> dash <> ToString[n] <> ".asc"] & /@ Range[m] Then fileList["D:\\20160615\\20160615", 5, 1] gives {"D:\\20160615\\20160615-1-1.asc", "D:\\20160615\...


2

Using OS shells commands seems to be much faster, although their output will need some massaging to obtain only the file names. For instance, the following works quite well on my system (Win7-64): Import["!dir /b /a-d C:\\Windows\\*", "Text"] // StringSplit[#, "\n"] & This command takes 0.11s to execute; for comparison the corresponding FileNames ...


6

As after half a year there is still no answer, here are some very short answers from my comments: the difference is just the file ending as far as I know. if you have installed MATLAB (or another software which also uses .m file extension) it is easier to let the OS distinguish between MATLAB files and Mathematica packages. because that now seems to be the ...



Top 50 recent answers are included