Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ob-julia, src block execution with extra newline characters from commentes at #+RESULTS: #8

Open
sfmb-mx opened this issue Jul 14, 2017 · 1 comment

Comments

@sfmb-mx
Copy link

sfmb-mx commented Jul 14, 2017

How can we avoid this in literate analysis can be annoying for code like the example below:

#+begin_src julia :session :results output :exports all
  # reading:
  fname = "../data/example.dat"
  f1 = open(fname) # IOStream(<file example.dat>)

  data = readlines(f1)
  # 3-element Array{Union(ASCIIString,UTF8String),1}:
  #  "this is line 1.\r\n"
  #  "this is line 2.\r\n"
  #  "this is line 3."

  for line in data
      println(line)
      # process(line)
  end
  close(f1)
#+end_src

The exported results have this behavior:

#+RESULTS:
#+begin_example

"../data/example.dat"
IOStream(<file ../data/example.dat>)

3-element Array{String,1}:
 "this is line 1."
 "42; 3.14"
 "this is line 3."





this is line 1.
42; 3.14
this is line 3.
#+end_example

Any idea?
Best regards!

@fleimgruber
Copy link

I had a shot at this, please see #14.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants