Tag Info

New answers tagged

3

This is a standard Excel XLSX file. It is not a compressed ASCII file. I don't know why LabView uses the lvm extension, it seems weird. But then I don't know anything about LabView. Just use Import["data.lvm", "XLSX"] Note: Office Open XML files are actually just ZIP files with a standardized directory structure with XML files inside. This is why you ...


1

This might help but it doesn't filter the images explicitly. First get the links from Google to the sites where these images are located, linksFromGoogle=Import["https://www.google.com/search?site=&tbm=isch&source=hp&biw=1280&bih=778&q=spikey&oq=spikey&gs_l=img", "Hyperlinks"] Then filter these links so you get links that ...


4

I suspect this is in the documentation, but just in case it is not obvious, one can indicate the import format as the first element of an array in the 2nd argument to Import: Import["http://www.soccerbase.com/teams/transfers.sd?season_id=142& team_id=142&teamTabs=transfers", {"HTML", "Data"}]


2

Assuming the file datagr.xls contains your data, import it using importeddata = Import["datagr.xls"][[1]]; and construct the edge list using Apply (@@@) edgelist = {DirectedEdge, UndirectedEdge}[[1 + #3]][#, #2] & @@@ importeddata alternatively, edgelist = If[#3==0, DirectedEdge[#,#2], UndirectedEdge[#,#2]]& @@@ importeddata or Map ...


1

It looks like Import has trouble with the character encoding on my computer: Import["http://hq.sinajs.cn/list=sh601006", "HTML"] (* "var hq_str_sh601006="`óÇØÌú·,13.13,12.87,13.37,13.77,12.95,13.38, [...] ;" *) We can find the encoding by looking at the HTML headers: Grid@URLFetch["http://hq.sinajs.cn/list=sh601006", "Headers"] Cache-Control ...


1

I have found that Import["http://hq.sinajs.cn/list=sh601006", "HTML"] works.


1

You can make a function that plots the content of a file like this: plot[file_] := Module[{mmm, figure, pos, b}, mmm = ReadList[NotebookDirectory[] <> file, Number, RecordLists -> True]; (* ... the rest of your code. *) ] To make an animation you have to first create a list with all the "frames", then you can display it with ListAnimate ...


2

Here is what worked in my case: First open a new notebook. Save it to your flashdrive, into the same folder where your "csv" files are located. type in: NotebookDirectory[] Out: /Volumes/TRANSCEND/MOptics/ Now you know exactly how the filename is represented in your system. I am on a mac, thats why my filenameSeperators are represented as "/". Go to ...


0

Example file: FilePrint["test.dat"] Import as all strings breaking each line into lists, assuming space delimited: stringform = StringSplit /@ StringSplit[ Import["test.dat", "Text"] , "\n"]; Here is an example operating on the second column of the result and writing it back out: Export["out.dat", StringJoin@Riffle[ ...


5

Don't copy-n-paste - that's error prone, simply do it directly from the text files. Here's an example: SetDirectory["junk"]; (* create 10,000 files, each with 10,000 elements... *) Monitor[Do[RandomInteger[1*^6, 10000] >> "set-" <> ToString[n] <> ".txt", {n, 10000}], n] (* read the files, Union as we go, resulting in final result of ...


0

In your first line of your code the variable a is assigned the string ["/Users/pedrofonsecazuccolo...." and then trying to use the Part function that is a[[1,Range[1,19],2]] which indeed is a wrong part specification for the string. Probably you intended dados[[1,Range[1,19],2]], which would take a Part from the data retrieved by Import[a] and assigned to ...


2

Easy fix: Export the result in the form ExpressionML Here is the code. N[ Sum[2/10^((n*(Floor[9/n] + 1) - 9)4), {n, 1, Floor[Sqrt[ 9]]}] + Sum[ 2/(10^((n(Floor[9/n] + 1) - 9)4) (10^(n*4) - 1)), {n, 1, Floor[Sqrt[ 9]]}] + Sum[2/(10^((o^2 - o - 9)* 4)*(10^(o*4) - 1)), {o, Floor[Sqrt[9]] + 1, 10}], ((10 + 1)^2 - 9)* 4] // ...


3

Being able to use this provides us with a way to produce quite secure CDFs designed for FreePlayer. Maybe it is a problem with encoding somewhere or with overloaded definitions of Get. Nevermind, as pointed out by Rolf Mertig if one uses OpenRead with DefineInputStreamMethod to convert a binary file to a stream, everything seems to work. Steps: ...



Top 50 recent answers are included