# Tag Info

7

You can use Import directly as follows: Import["MVI_9855-183.mp4", {"AVI", "ImageList", Range[1, 110, 20]}] This will import one frame every 20, between the first and 100th, and return them as a list of pictures. As you can see above, at least in the case of the mp4 files I have at hand I was able to "convince" Mathematica to import them directly by ...

5

Here are two ways. SemanticInterpretation is sort of fun but extremely slow: SemanticInterpretation["{26.2417,-98.432},{26.2407,-98.4247}", List[_, _] ..] Fixing up your data to fit Yves Klett's suggestion is much faster: ToExpression["{" <> "{26.2417,-98.432},{26.2407,-98.4247}" <> "}"] Both yield (* {{26.2417, -98.432}, {26.2407`, ...

5

The introduction of Assocation brings a powerful new way to handle this problem. Version 10.2 provides for import of JSON as nested associations without use of ToAssociations by using the format "RawJSON".   (* archive data *) ad = {"accept_rate" -> 75, "account_id" -> 395497, "age" -> 41, "badge_counts" -> {"bronze" -> 35, ...

4

The default type is an unsigned integer. You need to specify a suitable type, eg: testList = {1, 2, 3, -4}; file = "test1"; BinaryWrite[file, testList, "Integer8"]; BinaryReadList[file, "Integer8"] Close[file]; Note the read needs to know the type as well. See BinaryRead for the list of types. (Integer8 is only good for values in the range -128 to 127 of ...

4

This isn't a correct CSV file looking at it in Google Docs: In the second column one can see a complete Mathematica list as a string. The downloaded version has some issues too, so I read it in as a binary file and process it line by line. fp = OpenRead["C:\\Users\\XPS15-Sjoerd\\Downloads\\rutas.csv", BinaryFormat -> True]; routes = Reap[ While[ ...

3

Because the data in the text file has one column, importing using the "Table" format produces a nested N × 1 array, where N is the number of lines in the file. Instead, use the "List" import format, and you will get a one-dimensional array: Import["D:/Data/Mathematica/Convert_data/rawdata.txt", "List"] should give {1.59867, 1.57057, 1.60027, 1.51327, ...

3

The second number has too many digits to fit into machine precision therefore it is automatically cast to arbitrary precision. I do not believe this is specifically related to importing, e.g.: \$MachinePrecision a = 1.00000000000001; b = 2.1234567890123456789; c = 3.01; Precision /@ {a, b, c} 15.9546 {MachinePrecision, 19.327, MachinePrecision} Now ...

2

I have used ReadList command, MyList = ReadList[file]; And now, the result is right, MyList {{k0,{a0,b0,c0},{e0,f0,g0}} {k1,{a1,b1,c1},{e1,f1,g1}}} Your information has helped me to find a simple solution. Regards.

1

Try the following: (* Import your data as tab-separated values; extra "" will be included *) Import["c:\\Users\\Marco\\Desktop\\Sandbox\\rawdata.txt", "TSV"]; Flatten[%]; (* remove the "" caused by the extra tabs in your data file *) DeleteCases[%, ""]; (* Reshape your data into an array with your required dimensions *) ArrayReshape[%, {308, 508}]; (* ...

1

Without having the .csv file to work on, as guess who it is said, this should get you where your going. cord=Import["mydrive/file.csv","Data"]//ToExpression Again Please give a sample of what the data is in the .csv file.

1

MyList = Import[file, "Words"]

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