Tag Info

New answers tagged

2

Just rename "Table" to "Data" Import["am.txt", {"Data", {1, 2}}] (* {{1, 2}, {3, 4}} *) P.S. delete empty lines in the text file if you have them


0

Assuming the data is stored in "matrix.txt", you can do the following: m = Import["matrix.txt"]; temp = Partition[StringSplit[m], 4]; and finally form the matrices: Partition[#, {2}] & /@ temp This does the structure, maybe some type conversations are still necessary.


3

For Instagram you first have to initiate the service: instagram = ServiceConnect["Instagram"] This will open a dialog window where you have to click Sign in to Instagram. That will take you to Instagram API authentication website where you have to follow the steps to get an access key. Paste this access key in the Mathematica dialog. Once you are ...


1

Assuming the input is comma delimited, the following should do the trick: data = Import["C:\\Users\\nqduy\\Desktop\\test.txt", "CSV"] > {{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12}} partition = Partition[data[[1]], 3] > {{1, 2, 3}, {4, 5, 6}, {7, 8, 9}, {10, 11, 12}} Map[f, partition] > {f[{1, 2, 3}], f[{4, 5, 6}], f[{7, 8, 9}], f[{10, 11, 12}]} ...


5

The answer you are looking for is here: Import a Spreadsheet. Thus you can use: Import["~/test.xls", {"Data", 1, All, 2}] The syntax in your case is {"Data", # of sheet(s), # of row(s), # of column(s)}.


0

Its easy: just look at the structure of your imported data. Since you did not provide a file, we will use example data from Wolfram: tab = Import["ExampleData/elements.xls"] {{{"AtomicNumber", "Abbreviation", "Name", "AtomicWeight"}, {1., "H", "Hydrogen", 1.00793}, {2., "He", "Helium", 4.00259}, {3., "Li", "Lithium", 6.94141}, {4., "Be", "Beryllium", ...


1

In order to solve the problem exactly as it is stated - by finding the element with class "nav_pagenum" - I suggest this solution. On that page there are also links to posts where it is shown how to retrieve the element using Cases. Below I present a toy solution that I just happened upon. When you request a page that does not exist it will simply return ...


1

It does work by slightly rewriting your code: First let's create a list of law rules of the form of {"1"-> ... , "2" -> ...} and save it to an .mx file in the home cloud directory: data = "21"; url = "http://www.gesetze-im-internet.de/bgb/xml.zip"; xmlres = Import[url, Import[url, {"FileNames", 1}]]; myX["enbez", {}, {par_String}] := par; ...


5

MATLink 1.x is based on the MATLAB Engine interface, which sets its limitations and possibilities. What you are asking for is possible on Windows, but not on Mac or Linux. By default MATLink will start a new instance of MATLAB in the background. On Windows and Mac you can see this instance appear in the taskbar or dock. All MATLAB commands are evaluated ...


2

Some fake data: faketxtdata=StringJoin@@Table[ToString[RandomInteger[{0,10}]]<>" ",{10201}]; The first 20 characters of the data: StringTake[faketxtdata,20] (* 9 10 2 4 10 10 *) The file fakedata.txt contains a single string: Export["fakedata.txt",faketxtdata]; Using "Words" as the second argument of Import, imports words separated ...



Top 50 recent answers are included