Announcing the new Datavyu v1.3.6 with enhanced features and transcription support!

I used the text from the datavyu.org tutorial on batch operations to write a script for printing multiple opf files. Sometimes when I run the script, it tells me that there is an error in the lines with the commands

for file in filenames if file.include?(".opf") and file[0].chr != '.'

even though I copied them from the website. Other times when I run the script, it gets stuck at LOADING DATABASE and gives me a blank txt file. Any suggestions? TIA.

asked 12 Jun '14, 20:23

SEB's gravatar image

SEB
1224
accept rate: 0%

edited 12 Jun '14, 20:25


The problem isn't in line 18. Rather, if you look at the first line of the output in the scripting console, you'll notice that it's actually trying to load the following:

/Users/sarah/Desktop/datafiles293257.5.opf

which doesn't exist. Adding the missing "/" back after File.expand_path() fixes the problem.

filedir = File.expand_path("~/Desktop/datafiles/") + "/"
  filenames = Dir.new(filedir).entries
permanent link

answered 17 Jun '14, 10:53

GladysChan's gravatar image

GladysChan ♦♦
164116
accept rate: 0%

edited 17 Jun '14, 10:54

What does the error message say? Also, it's hard to say what could be wrong without looking at your script. Can you post the script and maybe send me a spreadsheet file? Thanks.

permanent link

answered 17 Jun '14, 10:02

GladysChan's gravatar image

GladysChan ♦♦
164116
accept rate: 0%

I'll send you the files as attachments. The complete output from the scripting console:


Running Script: step3PrintMutexMultiple.rb


LOADING DATABASE: /Users/sarah/Desktop/datafiles293257.5.opf NativeException: java.lang.NullPointerException: null loadDB at /Datavyu_API.rb:1350 load_db at /Datavyu_API.rb:1319 (root) at <script>:22 each at org/jruby/RubyArray.java:1615 (root) at <script>:18 org.jruby.embed.EvalFailedException: Native Exception: 'class java.lang.NullPointerException'; Message: null; StackTrace: java.lang.NullPointerException at org.datavyu.controllers.OpenC.openProjectArchive(OpenC.java:147) at org.datavyu.controllers.OpenC.openProject(OpenC.java:79) at org.datavyu.controllers.OpenC.openProject(OpenC.java:156)

at org.jruby.embed.internal.EmbedEvalUnitImpl.run(EmbedEvalUnitImpl.java:132)
at org.jruby.embed.jsr223.JRubyEngine.eval(JRubyEngine.java:129)
at org.jruby.embed.jsr223.JRubyEngine.eval(JRubyEngine.java:157)
at org.datavyu.controllers.RunScriptC.runRubyScript(RunScriptC.java:177)
at org.datavyu.controllers.RunScriptC.doInBackground(RunScriptC.java:141)
at javax.swing.SwingWorker$1.call(SwingWorker.java:277)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
at java.util.concurrent.FutureTask.run(FutureTask.java:138)
at javax.swing.SwingWorker.run(SwingWorker.java:316)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918)
at java.lang.Thread.run(Thread.java:695)

Caused by: org.jruby.exceptions.RaiseException: Native Exception: 'class java.lang.NullPointerException'; Message: null; StackTrace: java.lang.NullPointerException at org.datavyu.controllers.OpenC.openProjectArchive(OpenC.java:147) at org.datavyu.controllers.OpenC.openProject(OpenC.java:79) at org.datavyu.controllers.OpenC.openProject(OpenC.java:156)

Caused by: java.lang.NullPointerException at org.datavyu.controllers.OpenC.openProjectArchive(OpenC.java:147) at org.datavyu.controllers.OpenC.openProject(OpenC.java:79) at org.datavyu.controllers.OpenC.openProject(OpenC.java:156) ** SCRIPT ERROR **

LOADING DATABASE: /Users/sarah/Desktop/datafiles293257.5.opf NativeException: java.lang.NullPointerException: null loadDB at /Datavyu_API.rb:1350 load_db at /Datavyu_API.rb:1319 (root) at <script>:22 each at org/jruby/RubyArray.java:1615 (root) at <script>:18

See line 18 of /Users/sarah/Documents/RESEARCH/MotorLang/Datavyu/step3PrintMutexMultiple.rb: for file in filenames See line 22 of /Users/sarah/Documents/RESEARCH/MotorLang/Datavyu/step3PrintMutexMultiple.rb: $db,proj = load_db(filedir+file)


permanent link

answered 17 Jun '14, 10:10

SEB's gravatar image

SEB
1224
accept rate: 0%

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×46
×4
×2
×1

question asked: 12 Jun '14, 20:23

question was seen: 14,187 times

last updated: 17 Jun '14, 10:54

powered by OSQA