Hot answers tagged


Using a slightly modified version of vngx-jsch (source included), an open-source implementation of jsch, and JLink and a small but efficient Mathematica package this is now easily possible. All code can be browsed here, and most simply be installed by executing this twitterable line: (tested on Windows, Linux and Mac, but not on the Raspberry Pi). It should ...


Put[OutputForm[outString], "testOut.txt"] compare with Put[outString, "testOut0.txt"] Alternatively, you can use Export: Export["testOut2.txt", outString] (* or Export["testOut2.txt", outString, "Text"] *) or, WriteStream (thanks: Mr.Wizard) strm = OpenWrite["testOut2.txt"]; WriteString[strm, outString] Close[strm] to get the same result:


I am answering my own question to help out other .Net/Mathematica developers in the future. I am using random file names (DTWERG, ERYFGJ, IYIGGD) and it turns out when Mathematica exports an image file that has a slash and followed by : b, t, n, f, r it recognises/honors the escape slash. For example when a file name starts with an r as per the screenshots,...


Just apply string replacement to the list of files. No need to sort. Example: replacer = ReleaseHold@ StringReplace[#, RegularExpression["(\\d+)"] -> IntegerString[Hold@ToExpression["$1"], 10, 3]] & replacer /@ {"9.bmp", "10.bmp"}


Here's how I would do it with PaddedForm: Export["filepath.txt", StringJoin[ToString@PaddedForm[#, 6] & /@ {-1, 2, 3, 4, 5}]] This works with negative numbers as well. Will work the same with WriteString. If you want more control over the padding, you can use your own function... custompad[num_, padlength_?IntegerQ] := StringPadLeft[ToString@num,...


I don't know if this is what you are after, but this is how I always import / export long lists: Export Export["C:\\Directory\\list.txt", list] Import list = ToExpression[Import["C:\\Directory\\list.txt", "List"]];


Here is the code used by the OP to solve its issue: nb=NotebookOpen[NotebookDirectory[]<>"style1.nb"]; tmp=NotebookGet[nb]; estilos=Cases[tmp,Cell[StyleData[x_,y___],z__],∞]; NotebookClose[nb]; SetOptions[EvaluationNotebook[], StyleDefinitions -> Notebook[estilos]] style1.nb is my own style with 1 style cell per type of cell

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