# Tag Info

7

The following should be fast enough: myList = ReadList["infile.txt", Number, RecordLists -> True]; // AbsoluteTiming {4.64517, Null}

7

From Wolfram support: the reason 10.4.0 cannot import the excel file: the command ReinstallJava[CommandLine -> "java", JVMArguments -> "-Xmx2048m"]; is incorrect for 10.4.0. The correct command is: ReinstallJava[JVMArguments -> "-Xmx2048m"];.

7

I know this is an old question, but I ran into this problem myself. The permanent solution for me was to alter the settings of JLink directly. As for most commenters too, increasing the heap-space by giving commandline options to ReinstallJava and friends didn't work. Specifically, I tried to increase the heap-space by specifying the complete CommandLine ...

6

You can temporarily change CellContext of the notebook with SetOptions or CurrentValue but if the notebook isn't opened yet, this is faster: Module[{path, nb} , path = (*path*); nb = NotebookOpen[ path, CellContext -> "Global", Visible -> False]; NotebookEvaluate[nb, InsertResults -> False]; NotebookClose[nb] ] You can use ...

5

It does not work because of different data elements, compare Import["ExampleData/caffeine.xyz"] with data structure and your data structure: but change it to: with Import["NP3D.xyz"] you will get: full data looks like You can make an animation with these snapshots: data1 = StringRiffle[#, "\n"] & /@ ...

5

JLink Here is a solution that uses JLink to leverage Java's support of XML Schema: Needs["JLink"] InstallJava[]; LoadJavaClass["javax.xml.validation.SchemaFactory", AllowShortContext -> False]; LoadJavaClass["javax.xml.XMLConstants", AllowShortContext -> False]; validateXml[xsd_String, xml_String] := JavaBlock @ Module[{factory, xsdSource, ...

3

If you have flexibility in choosing your txt file data format, then you can work backwards. Start by constructing the objects you want in Mathematica. For example, a list of vectors: testObject=Tuples[{0, 1}, 3] (*{{0, 0, 0}, {0, 0, 1}, {0, 1, 0}, {0, 1, 1},...,{1, 1, 1}}*) Then export this into a text file with a convenient format (such as CSV): ...

3

This seems to work: URLFetch["https://docs.google.com/document/export?format=txt&\ id=17m1JfjEbrna7e9INZv-FXZQ9yQJd8d1Uu2LFEPyT_ZI&token=\ AC4w5VhkHSfLIe2xvAUWQC9XHb1lAmM7Xw%3A1460476462625"] (* "When the soil were finally depleted of all nutrients, we \ realised that paper isn't edible. Or is it? Now all paper is \ digestible, we eat the wrapping ...

3

As the @george2079 's suggetion,I post my solution from a friend as an answer,but I'm sure there are more better method can do this.I accept myself answer just for reader.If anyone have post better solution,I'll change the acceptance. $Version "10.3.1 for Microsoft Windows (64-bit) (December 21, 2015)" string = First@Import["file address"]; Rule @@@ ... 3 As mentioned in the comments to your question, you just Import the whole data and then manipulate it afterwards. This is (I believe) a very transparent way to achieve the end result that you want and also illustrates why you should not use an "advanced" Import: Let's produce some sample data dim = 100; data = RandomReal[{-1, 1}, {dim, 3}]; ... 2 refering to Can I read Chinese characters with ReadList correctly? here is the solution: first try FromCharacterCode[ ToCharacterCode[ ReadList["...file.txt", Record, 1]], #] & /@$CharacterEncodings read the output then select the one of \$CharacterEncodings which correctly translated the characters (which may depend on your systems or Mathematica ...

2

I checked it with 64-bit OS and it worked. Apparently It only work in 64-bit version of windows (7).

2

Let's say this is your CSV file, http://i.imgur.com/8giNhRb.jpg, penguins http://i.imgur.com/ZQXCY7c.jpg, penguins http://i.imgur.com/bQ6lqNU.jpg, penguins http://i.imgur.com/lxzTgH9.jpg, penguins http://i.imgur.com/eHdgXnt.jpg, penguins http://i.imgur.com/Bmy54vW.jpg, penguins http://i.imgur.com/MtzebxR.jpg, penguins http://i.imgur.com/pkDhR1w.jpg, ...

2

Using NETLink we can come close to your specs. Note that passworded.xlsx is the password protected file, the password is "peter" and notPassworded.xlsx is the temp copy of a non-protected file. Needs["NETLink"] LoadNETType["System.GC"]; excel = CreateCOMObject["Excel.Application"]; excel[Visible] = True; workbook = excel@Workbooks@ ...

2

This will split the text into chunks and plot them as molecular plots, imglist = ImportString[ExportString[#, "Table"], "XYZ"] & /@ Partition[ StringSplit[ Import["http://comsics.usm.my/tlyoon/teaching/ZCE111_1516SEM2/\ data/NP3D.xyz", "Text"], "\n"], 12]; But, those carbon atoms sure are close together.... imglist[[405]] Maybe the ...

2

Okay, so this is what it looks like with standard coloring of the residues: Import["ExampleData/1PPT.pdb", ColorFunction -> "Residue"] But now, if we want to change the residue colors, we need to change the value of a certain internal color list called GraphicsMoleculePlotDump`residueColorRules residuelist = {"Gly", "Pro", "Ser", "Gln", "Pro", ...

1

You need to evaluate the cells. You can evaluate the current cell by using "Shift+Enter". For an introduction to evaluation, here are some helpful references: Interactive Usage page of The Wolfram Language: Fast Introduction for Programmers. Practicalities of using the Wolfram Language from An Elementary Introduction to the Wolfram Language by Stephen ...

1

What follows is a variation on a previous answer To exclude row 4 from comma-delimited data: dataGood = Flatten[#, 1] & @(Import["/path/to/myfile.txt",{"Data", #, {All}}] & /@ {Range[3], Range[5, 6]}); and dataGood // TableForm For comparison: dataAll = Import["/path/to/myfile.txt", {"Data", {All}, {All}}]; dataAll // TableForm ...

1

Here is the plain text of the VCF file from your link: BEGIN:VCARD VERSION:2.1 N;CHARSET=UTF-8;ENCODING=QUOTED-PRINTABLE:=E6=B5=8B=E8=AF=95;;;; FN;CHARSET=UTF-8;ENCODING=QUOTED-PRINTABLE:=E6=B5=8B=E8=AF=95 TEL;HOME:12345 678 9 END:VCARD Given this, Mathematica's answer is not surprising. Perhaps the odd characters are representatives of a font that is not ...

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