Hot answers tagged

15

Yes. The documentation mentions here that it can import ID3v1, ID3v2 and APE tags. The metadata is returned in a nested association. Now to try it on whatever mp3's I have lying around: mymp3 = Import["Mick Maguire.mp3", "MetaInformation"] Keys[mymp3] (* result: {"ID3v2", "ID3v1"} *) This file happens to have both v1 ...


11

Update 2: workflow to create perfectly cubical voxels In update 1, I discovered that although MaxCellMeasurewill allow you to control the resolution of the base mesh, ToElementMesh makes some internal choices to refine the mesh. Unfortunately, this refinement makes it virtually impossible to guarantee that the voxels are perfect cubes. Therefore, I created ...


10

Unfortunately this is indeed a bug and it's fixed for the next version. The workaround is to use ExtractArchive first, then Import the resulting files. You can extract specific files from an archive using the 3rd argument.


8

There is now a Chrome app for opening Wolfram notebooks in Wolfram Cloud. Once you've installed the app, you can visit your Google Drive on the web and double-click to open a notebook file. You'll get something that looks like this... Choose Wolfram Cloud. If you've never done it before, you'll be prompted to log into Wolfram Cloud, and then asked to link ...


7

First, import the string. In your case it'll just be Import["name of the file.txt", "Data"] s = ImportString["r&=3&a&=3&b&=4&c&=10\\\\ r&=3&a&=8&b&=15&c&=120\\\\ r&=3&a&=20&b&=55&c&=1540\\\\ r&=4&a&=34&b&=119&c&=7140\\\\ r&...


6

With the ability to connect to Python I found this snippet of code helpful. It imports a STATA .dta file using pandas and then outputs it as a Wolfram Dataset. importDTAMP[fileName_] := Module[{}, python37 = StartExternalSession[<|"System" -> "Python", "Version" -> "3.7.3"|>]; ...


6

Alternative answer: Use the SVG importer from my Prototypes paclet: https://github.com/arnoudbuzing/prototypes/releases/tag/0.5.6 To install the paclet, run this command: PacletInstall["https://github.com/arnoudbuzing/prototypes/releases/download/v0.5.6/Prototypes-0.5.6.paclet"] Note that this paclet has many many functions, but you may be able to ...


6

Assuming that I understood your right... making my toy-data and the filenames data = Table[RandomInteger[200, 20], {60}]; files = StringJoin["data", #, ".csv"] & /@ (ToString /@ Range[60]) export... Export[#[[1]], #[[2]]] & /@ ({files, data}\[Transpose]); Get the data in, similar like you did: inFiles = FileNames["*.csv", NotebookDirectory[]]; ...


6

Assuming I understand your data structure correctly, you could do something based on the following: SplitBy[Import["file.txt", "List"], StringMatchQ["New entry."]][[2 ;; ;; 2]] This imports the file as a list of strings, and then splits the list into sublists everytime an element is "New Entry.". You can then take ...


6

Just for completeness: it is also possible to do all this with just using options for Import: data=Import[fname, {"Table", "Data", All, {2, 4}},"FieldSeparators"->{"=", "&", "\\\\"}] see the documentation for the "Table" format for details: http://reference.wolfram.com/language/ref/...


5

You should always specify the format in Import. "Data" is not the format. It is the input element. Add the format to the command. If you don't, the system will guess the format based on the file contents and the file name. I don't think it's a good idea to rely on guesses when any level of reliability is expected. XLSX files are in fact ZIP files, so ...


5

If your only goal is to get a Dataset, then just use cv19DeathsCSV = Import[ "https://raw.githubusercontent.com/CSSEGISandData/COVID-19/master/csse_covid_19_data/csse_covid_19_time_series/time_series_19-covid-Deaths.csv", "Dataset", "HeaderLines" -> 1 ] I can't tell you why SemanticImport is doing what it does, other than it uses heuristics ...


5

Decimation of mesh is not a trivial task if you want to preserve the visual features of the original mesh. If you want to tap into the efforts of people that have been working on the problem for many years, you could use the freely available MeshLab to perform the decimation with a script driven from Mathematica. Here is one possible workflow (Note: ...


5

{dxf, edges, vd} = Import["(...path...)/input.dxf", #] & /@ {"Graphics3D", "LineData", "VertexData"}; edges = UndirectedEdge @@@ edges; gives dxf = Graphics3D[{{EdgeForm[], {RGBColor[0., 0., 0.], {Text[StyleForm["1", FontColor -> RGBColor[1., 0., 0.]], {75., 25., 0.}, {0, 0}], Text[StyleForm["2", FontColor -> RGBColor[1., 0., 0.]], {115....


5

You can work like this: import the data, ending the Import expression with a semicolon so to not display the entire table. rbraw = Import["https://raw.githubusercontent.com/benhowe75/rubidium_hyperfine_414/\master/simple.csv", "Dataset", HeaderLines -> 1]; Then you can use the name of the dataset and specify the elements you want to display with ...


5

Import[myfile.ndjson,"JSON"] doesn't work because the file as a whole is not valid JSON. But each line is valid JSON and so we can treat the file as a stream and read it one line at a time. The simplest way to do this would be stream = OpenRead@"~/test.ndjson"; ClearAll[line]; result = {}; While[line =!= EndOfFile, line = ReadLine[...


5

( Not an answer, extended comment.) In this particular case (the code of that site today): lsData = Import["https://www.worldometers.info/coronavirus", "Data"] works. Meaning, the data can be investigated further using Cases, Part, and TableForm (or other tabular formatting function.) For example, this list lsTbls = Cases[ lsData, {{&...


5

As suggested in the comments, the current version of Mathematica (12.1.1) import functionality of VTK files seems restricted to legacy format files, and it appears to ignore field data. Sample VTK file Here's a simple example of a cube with scaler nodal data taken from here. SetDirectory[NotebookDirectory[]] writeScript[filename_, txt_] := Module[{file}, ...


5

(* Import as text first *) text = Import["test.json", "Text"]; (* Split out the lines *) lines = StringSplit[text, "\n"]; (* Replace lines containing ONLY } with }, * then stitch the lines back together with newlines and remove the final comma. * Finally, surround all objects with a JSON list [...], not braces. *) newjson = ...


5

Yep. You can do this no problem. I suggest looking at the documentation on the workflow in NotebookEvaluate[]. For example, create another notebook with the following contents. Table[ NotebookEvaluate["/path/to/previous/notebook.nb"], {k, k_min, k_max}] I'd suggest that maybe a simpler way would be to confine operations to a single note book with ...


5

You seem to have a problem that Excel puts some errors containing string expressions. If they appear in random places but you know how they look you can delete them based on their pattern. After you import: data=ToExpression[Import["https://pastebin.com/raw/rSVRyTge"]]; you can remove them whether by exact pattern DeleteCases[data,{"",-6 ...


4

I wrote such a cross-platform tool to convert other formats to wolfram format: WolframExchange Usage wex in.yml # check file but no output wex in.yml -t # output only text wex in.yml -c # output only binary wex in.yml -ct # output both text and binary Result


4

Well... (importing your .STL object): obj = Import["Link.STL"] ...if nothing else a very poor man's solution for simple visual in an interactive interface is just random sampling of points (i know it is far from spectacular :-) but is very light): pts=RandomPoint[obj,1000]; obj//ByteCount Graphics3D[Point[pts]]//ByteCount 1808792 24792 Also I ...


4

<< is meant to be used only with a simple name on the right, and it will interpret this name as a string. << name means Get["name"] and not Get[name]. << f[] means Get["f[]"] and not Get[f[]]. There are also issues with precedence. << x <> y means StringJoin[ Get["x"], y ]. Try this: Hold[<< x <> y] // FullForm (...


4

Nice spectrum. rbraw = Import["https://raw.githubusercontent.com/benhowe75/rubidium_hyperfine_414/master/simple.csv", "Dataset", HeaderLines -> 1]; rbraw[Map[Reverse]][ListPlot[#, PlotRange -> All, ImageSize -> 500] &]


4

In chrome, after you run the ngram query, you can go to the "Developer tools", find the source file starting with graph?content=", search for the string var data (search is under the triple dots on the upper right corner), and find the time series var data = ...


4

Update Add the image URL's {https://www.freeart.com/gallery/m/mondrian/mondrian8p.jpg,https://www.freeart.com/gallery/m/mondrian/smondrian1.jpg,https://www.freeart.com/gallery/m/mondrian/smondrian2.jpg,https://www.freeart.com/gallery/m/mondrian/smondrian3.jpg,https://www.freeart.com/gallery/m/mondrian/smondrian4.jpg,https://www.freeart.com/gallery/m/mondrian/...


4

Not sure whether I got your right, but maybe this is ist: You can use StringCases in combination with Counts to get the corresponding results. Given your input as data (I don't have your textfile): data = "r&=3&a&=3&b&=4&c&=10\\ r&=3&a&=8&b&=15&c&=120\\ r&=3&a&=20&b&=55&c&...


3

Update Plot data for several regions provinces = {"lombardia", "sicilia"}; dataByProvince = covid19Italy /@ provinces; dataByProvince // Map[(KeyTake[#, {"date", "total infected"}] &), #, {2}] & // Values // Flatten[#, 1] & // DateListPlot[#, ScalingFunctions -> "Log", PlotLegends -> Capitalize@provinces, PlotMarkers -&...


3

I reproduce the problem with Mathematica 12.1 on Windows 10 x64: the transparency information is lost. It is a bug, please report it to the support. I've found a simple workaround working perfectly in this concrete case: I simply opened the file with Adobe Acrobat and then printed it to the "Microsoft Print to PDF" virtual printer (in the Print dialog I've ...


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