7

I have a file whose contents I would like to view dynamically from a generic Org-mode buffer.

For example, suppose I have a file called data.csv, and I'd like to display some of its contents when I visit study.org. To make up one way that this might look, study.org might appear as follows:

# -*- mode: Org; coding: utf-8; -*-
...
#+INCLUDE: "data.csv" :head 5
#+BEGIN_INCLUDE
id,name,count
1,recursion,48
2,exercise,55
3,ambrosia,85
4,division,16
#+END_INCLUDE
...

I see that someone has asked this question in the context of the Org-mode export mechanism (How to embed external file contents in org file?), but I don't see a way to include external file content in an Org buffer.

Does Org-mode support this sort of thing?

1

1 Answer 1

4

you can use a shell source code block

#+BEGIN_SRC sh :results output drawer
head -n 5 data.csv
#+END_SRC

Then you hit C-c C-c inside the block and run the source code which will show below the first five lines of the file in a results block

2

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.