New answers tagged

3

I think you're looking for the -linewise option to wolframscript. Here's my little script, tsv2csv #!/usr/bin/env wolframscript -linewise Print@StringReplace[$ScriptInputString,"\t"->","] I tried it, via ./tsv2csv < in > out on the file in a b c d e f g h i and got a,b,c d,e,f g,h,i I believe the script is essentially called 3 ...


0

This is not robust but should be enough to get you started. ClearAll[applyToFile] applyToFile[filename_, typeSpec_, func_, batchSize_Integer?Positive] := Module[{read = OpenRead[filename], write = OpenWrite[], readBach, writeFileName}, readBach = ReadList[read, typeSpec, batchSize]; While[readBach =!= {}, readBach = func /@ readBach; ...


8

Here's a version of the script that works: #!/usr/bin/env wolframscript -print All -run \'Needs[\"ComputerArithmetic`\"]\' Ulp[1000.] This is a limitation of -print All that we probably should either document or find a fix for, though the latter is rather challenging. When executing a script normally or using -print, wolframscript can essentially tell ...


Top 50 recent answers are included