Org Tables Changed My Life

Gavin Freeborn
24 Mar 202419:10

Summary

TLDRThis video delves into the powerful table functionality of Emacs' Org mode, showcasing its capabilities for tabular data entry, spreadsheet-like manipulation, and advanced features. The host demonstrates basic table creation, data manipulation, and the integration of calculations and references within Org mode. They also explore Org Babel for executing code snippets and generating dynamic content, illustrating practical applications such as financial calculations and data visualization with R programming language, all within the versatile Org mode environment.

Takeaways

  • 📊 Org mode offers powerful table functionalities similar to HTML and Markdown for tabular data entry.
  • 🧮 Org mode integrates spreadsheet capabilities for data manipulation directly within the editor, including references and calculations.
  • 🔄 Users can easily manipulate tables in Org mode by adding, removing, or moving rows and columns using keyboard shortcuts.
  • 📑 Org mode supports advanced features like passing tables to an interpreter and using a programming language for more complex data handling.
  • 💡 The video demonstrates basic table creation, manipulation, and the use of spreadsheet functions within Org mode.
  • 🔢 Org mode allows for calculations in tables using specific keyboard commands, such as 'C-=' for column calculations and 'C-c *' for field-specific calculations.
  • 🔗 References to other tables or ranges within a table can be made using a combination of row and column indicators, enhancing data linkage and calculation accuracy.
  • 📈 Org Babel enables the execution of code blocks within Org files, allowing for integration with various programming languages for more advanced data processing.
  • 📚 The script showcases practical applications of Org mode tables, including financial calculations and data visualization with programming languages like Python and R.
  • 🌐 The video mentions 'Simx', an Emacs setup tailored for scientists and engineers, as a potential starting point for those new to Emacs and looking for specialized functionality.
  • 🎓 The speaker encourages viewers to explore Org mode's capabilities further, especially for automating personal and professional tasks, and to provide feedback for additional content.

Q & A

  • What is the main topic discussed in the video script?

    -The main topic discussed in the video script is the table functionality in org-mode, which includes creating and manipulating tables, performing calculations, and integrating with programming languages for advanced features.

  • What is org-mode and why is it useful?

    -Org-mode is a mode in Emacs for organizing and editing notes, lists, and projects. It is useful because it allows users to create tables, manage tasks, and even write documents with powerful features like spreadsheet functionality and integration with programming languages.

  • How can you create a table in org-mode?

    -You can create a table in org-mode by initializing it with a horizontal bar and then pressing the Tab key to start entering data. You can also use a vertical bar followed by 'a' and Tab to create a header.

  • What are some advanced features of org-mode tables mentioned in the script?

    -Some advanced features of org-mode tables include the ability to manipulate tables by adding or removing rows and columns, performing calculations with spreadsheet functionality, referencing other tables, and using org-babel to execute code within an org file.

  • How can you perform calculations within org-mode tables?

    -You can perform calculations within org-mode tables using the 'control equals' command to enter a calculation for a column, or 'control U control equals' for a specific field. You can also use references to other cells or tables for more complex calculations.

  • What is org-babel and how is it used in the context of org-mode tables?

    -Org-babel is a feature of org-mode that allows you to execute code blocks within an org file. It can be used to generate results from programming languages like Python or R, which can then be used as input or output within org-mode tables.

  • How can you reference data from one table to another in org-mode?

    -You can reference data from one table to another in org-mode by using the 'remote' keyword followed by the table name and the cell reference, such as 'remote:costs@2$2' to reference the second row and second column of a table named 'costs'.

  • What is the significance of the '$' and '@' symbols in org-mode table calculations?

    -In org-mode table calculations, the '$' symbol is used to reference a column, and the '@' symbol is used to reference a row. This allows for precise calculations based on specific cells within a table.

  • How can you import data into an org-mode table?

    -You can import data into an org-mode table by using the 'table-import' command or by selecting a region of comma-separated or tab-separated values and using the 'control vertical bar' command to convert it into a table.

  • What is the practical application of org-mode tables discussed in the script?

    -The script discusses using org-mode tables for practical applications like financial calculations, daily life calculations, and even generating graphs or plots using programming languages integrated with org-babel.

Outlines

00:00

📊 Org Mode Table Functionality Overview

This paragraph introduces the video's focus on Org Mode's table functionality, which allows users to enter tabular data akin to HTML and Markdown. It highlights Org Mode's spreadsheet capabilities for data manipulation within the editor, including adding, removing, and referencing tables. The speaker emphasizes the advanced features like passing tables to interpreters for complex tasks, and the overall utility of Org Mode for note-taking and data management. The video promises to cover basic table creation, advanced manipulation, spreadsheet functionalities, and interpreter usage.

05:01

🔍 Deep Dive into Org Mode's Table Manipulation and Calculations

The speaker discusses advanced table manipulation techniques in Org Mode, such as moving fields and rows with keyboard shortcuts, and copying and pasting data within tables. They demonstrate how to generate tables from comma or tab-separated values and introduce the powerful spreadsheet functionalities, including column-wise calculations and cell-specific formulas. The paragraph also covers referencing cells and ranges within tables for dynamic calculations, showcasing Org Mode's ability to handle complex data operations seamlessly.

10:02

🔗 Leveraging References and Calculations in Org Mode Tables

This section explores the use of references for dynamic calculations across different tables in Org Mode. The speaker explains how to create references using a combination of row and column indicators and perform operations like summing values from referenced cells. They also touch upon the use of Calc, Emacs's built-in calculator, for arithmetic and algebraic operations within tables. The paragraph concludes with an introduction to org-babel, a feature that allows executing code blocks in various programming languages directly within Org files.

15:03

📈 Practical Applications and Org Babel Integration

The final paragraph presents practical applications of Org Mode's table functionalities, such as integrating with SQL databases for data manipulation and visualization. The speaker demonstrates how to filter, export, and import data using SQL queries within Org tables. They also showcase the integration of Org Babel with programming languages like Python and R for more complex data analysis and graphical representation. The video concludes with a mention of Simx, an Emacs setup tailored for scientists and engineers, and an appreciation for the channel's supporters.

Mindmap

Keywords

💡Org Mode

Org Mode is a document and information organizer for Emacs, which is a powerful text editor. It is designed for note-taking, project planning, and authoring with a fast and effective plain-text system. In the video, Org Mode is the central theme, with the speaker discussing its table functionality and advanced features for data manipulation and calculations, which are essential for organizing and managing information.

💡Tables

In the context of the video, tables refer to the tabular data structures within Org Mode that allow users to organize information in rows and columns. The script mentions using tables for entering data like names and ages, and the speaker demonstrates how to create and manipulate tables, emphasizing their importance in the Org Mode ecosystem.

💡Spreadsheet Functionality

The term 'spreadsheet functionality' in the script refers to the capability of Org Mode to perform calculations and data manipulation similar to traditional spreadsheet software. The speaker highlights this feature as powerful for tasks such as financial calculations, showcasing how Org Mode can handle complex data operations within a plain-text environment.

💡Data Manipulation

Data manipulation involves altering and organizing data within tables. The script discusses how Org Mode allows users to add, delete, and move rows and columns in tables, as well as copy and paste data. This is crucial for users who need to dynamically adjust their data structures without losing the integrity of the table format.

💡Calculations

Calculations in Org Mode refer to the ability to perform mathematical operations within tables. The script explains how users can use Org Mode's built-in functions to add, subtract, and reference values for computation. This feature is exemplified by the speaker when demonstrating how to add a constant value to a column or perform more complex calculations using references.

💡References

In the script, 'references' are used to link data from one table to another or within the same table. The speaker explains how to create references to specific cells or ranges of cells, allowing for dynamic calculations that update automatically when the referenced data changes. This is particularly useful for creating interconnected data sets and maintaining consistency across a document.

💡Interpreter

The 'interpreter' keyword in the script refers to the ability to pass table data to an external programming language for advanced processing. The speaker mentions using an interpreter to extend Org Mode's capabilities, such as generating graphs or performing statistical analysis, by leveraging the power of languages like Python, R, or Emacs Lisp.

💡Kelk

Kelk, mentioned in the script, is a stack-based calculator in Emacs that Org Mode can utilize for its calculations. It is a powerful tool that can handle a wide range of mathematical operations, from basic arithmetic to more complex functions, enabling Org Mode users to perform advanced calculations within their tables.

💡Org Babel

Org Babel is a feature within Org Mode that allows for the execution of source code blocks in various programming languages. The script describes how Org Babel can be used to generate results from code, such as creating a list of numbers or filtering a database query. It is a demonstration of how Org Mode can be extended for more complex tasks beyond its native capabilities.

💡SQL Light Database

In the context of the video, an 'SQL Light Database' is a simplified version of a traditional SQL database, which is used to manage and query data. The script includes an example where the speaker uses Org Babel to interact with an SQL Light Database, demonstrating how to filter, import, and export data using Org Mode's capabilities.

Highlights

Introduction to org mode's table functionality for tabular data entry, similar to HTML and markdown.

Emacs and org mode's powerful spreadsheet functionality for data manipulation and calculations.

The ability to reference and calculate data within org mode tables for financial management and other uses.

Advanced features in org mode that allow tables to be passed to an interpreter for more complex tasks.

Basic table creation in org mode using simple horizontal bars and tab navigation.

Creating headers in tables for better data distinction using vertical bars and tab.

Manipulating tables by moving fields and rows with arrow keys and modifiers in Emacs.

Adding and deleting rows and columns in tables with specific key combinations.

Copying and pasting data within tables using control space and rectangle selection.

Generating tables from comma-separated or tab-separated values using control and vertical bar.

Importing tables from CSV files using table import feature in org mode.

Performing calculations in tables using control equals and column references.

Entering specific field calculations with control U and the use of dollar signs for row references.

Using references for advanced calculations, combining row and column references for complex formulas.

The integration of calc, Emacs's built-in stack-based calculator, for advanced mathematical operations in tables.

Executing code within org files using org-babel for generating results and automating tasks.

Practical application of org mode tables with programming languages for database manipulation and data processing.

Using org-babel with R programming language to generate graphical plots from table data.

The potential of org mode for automating financial and daily life calculations, as well as generating graphs and plots.

Invitation for viewers to learn more about advanced features of org mode and its practical applications.

Transcripts

play00:00

how's it going you guys I'm here today

play00:02

to talk to you once again about org mode

play00:05

specifically we're going to talk today

play00:06

about their table functionality tables

play00:09

in org mode can be used for what you'd

play00:10

expect in most other markup languages

play00:12

like HTML and markdown for entering

play00:14

tabular data you know kind of like your

play00:17

name your age all that sort of stuff now

play00:19

another thing that you kind of get with

play00:20

emac and org mode that I find quite

play00:22

powerful is the spreadsheet

play00:24

functionality you can also manipulate

play00:26

the data um using the editor itself so

play00:29

delete adding removing different tables

play00:32

rows fields that sort of stuff but you

play00:35

also get spreadsheet functionality for

play00:36

doing references and calculations which

play00:38

I find super helpful for doing my

play00:40

finances as well as the usual sort of

play00:43

small level uh table functionality that

play00:45

You' kind of hope for when you're

play00:46

referencing other tables you can do a

play00:48

lot of that there um and in addition you

play00:50

can do some really Advanced features

play00:51

where you take these tables you can pass

play00:54

them to an interpreter use a programming

play00:56

language of your choice to do some more

play00:57

advanced features and then spit that out

play00:59

as a that you can use later this is one

play01:01

of the things that I find extremely

play01:03

powerful with emac and let you kind of

play01:05

come up with ideas write it all down so

play01:07

you can reference it later and then get

play01:09

the results that you want and not really

play01:11

think too much about what's the best

play01:12

tool for the job you can kind of just

play01:14

work with it let the data flow as you

play01:15

want and reference it later tables are

play01:18

one of those things that I myself have

play01:19

used more and more over the years and

play01:21

have slowly fallen in love with it's

play01:23

been one of those things that I think

play01:24

org really gets right and hopefully by

play01:27

the end of this video you guys will feel

play01:28

the same way we'll start off with some

play01:29

very basic functionality just designing

play01:31

a table then we'll move into more

play01:34

advanced stuff like manipulating the

play01:35

table using emac and then we'll move

play01:38

into references calculations and the

play01:40

spreadsheet functionality and then

play01:41

finally we'll move into The Interpreter

play01:44

level stuff that's a bit more advanced

play01:46

and extremely powerful now without any

play01:48

more delays let's get into the video so

play01:50

first off let's look at creating a table

play01:52

so tables can be initialized using a

play01:55

quick little just horizontal bar like so

play01:57

and if you just hit tab boom you've got

play02:00

another table just started so usually

play02:02

what I like to do is I usually go ahead

play02:05

and start entering some data so let's

play02:06

say we want to make our heading line

play02:08

name and age and then I can hit Tab and

play02:11

it will start letting me enter in data

play02:14

now often you want to make like a little

play02:15

header so it's a bit nicer because if I

play02:17

just entered in Gavin uh you guys don't

play02:19

need to know my age I'm I'm for all you

play02:21

know I'm

play02:22

100 uh and then I could keep going but

play02:24

usually you want something to kind of

play02:26

distinguish these two and so to do that

play02:27

you can do a vertical bar and then a and

play02:30

hit Tab and it will sort of fill that in

play02:32

for you and create a little header so

play02:34

that's basically what I say here and you

play02:36

can navigate these guys using tab kind

play02:39

of as you'd expect and then you can use

play02:41

enter um to kind of uh go to the next

play02:43

level now moving on to a more advanced

play02:46

feature we have the ability to actually

play02:47

manipulate these tables um so for

play02:49

example if we wanted to say move things

play02:52

around you can use shift and the arrow

play02:54

keys to kind of move around a field and

play02:58

we'll go ahead and undo that and you

play02:59

could do the same obviously with any of

play03:01

these fields now you can also use meta

play03:04

to kind of move say an entire column

play03:06

around or an entire row

play03:08

around um and in addition you can use

play03:11

shift in combination with meta with down

play03:15

to add one and then with up to delete it

play03:17

my up key is broken so I can't show that

play03:20

um and then you can do some extra stuff

play03:22

with rows as well so right would add a

play03:25

row left would delete a row or sorry

play03:27

column which is quite powerful and quite

play03:30

helpful for sort of the general

play03:31

manipulation stuff obviously it depends

play03:33

on where the cursor is but yeah so

play03:34

that's kind of the main workflow for

play03:36

sort of manipulating the table is using

play03:38

the arrow keys with different modifiers

play03:40

you can obviously do the regular sort of

play03:42

marking deleting and moving stuff around

play03:45

as you'd expect now another thing when

play03:46

it comes to modifying the different data

play03:49

is that sometimes you want to copy paste

play03:50

and so the way that this is done is

play03:52

actually pretty interesting so you can

play03:54

do control space here and kind of move

play03:57

your cursor around and so you can do

play03:59

kind of row and column selection like

play04:02

this so while it does show that I'm

play04:05

going across two lines I'm actually

play04:06

selecting from this little rectangle

play04:08

right here and so I can do crl c crl x

play04:11

and then any of these Keys above us

play04:13

let's do alt W and so as you can see it

play04:16

said that I copied and so now if I do

play04:18

contrl c crl xrl y it will paste that

play04:22

data um and I can kind of do say for

play04:24

example if I did here and went down to

play04:27

here and did crl C CR X Alt W and copied

play04:31

like we just did and then do crl c CR XR

play04:34

y um we can copy and paste just the

play04:37

column right here um so this can be very

play04:40

helpful and very powerful if you guys

play04:42

want to do some more like modifications

play04:44

and moving things around without uh

play04:46

disrupting the actual layout too much

play04:49

now I'll admit I don't use this all the

play04:51

time but it is helpful on the occasions

play04:53

where I kind of feel like I need it and

play04:54

now let's move on to generating tables

play04:56

generating tables is actually a really

play04:58

cool feature Within emac there's a bunch

play05:00

of different ways to do it this is just

play05:01

two of them so uh one of the ways is

play05:04

using control and then the vertical bar

play05:06

and so you'll see it right down here in

play05:07

my like what I'm typing so you can kind

play05:09

of turn anything that's comma separated

play05:11

or tab separated into a table um so this

play05:14

is really useful like I mentioned if I

play05:15

just copy pasted say a list from a

play05:17

website or something like that I can uh

play05:20

select the region do contrl c vertical

play05:22

bar and it will turn that into a table

play05:25

now another example is using U Altex or

play05:29

table

play05:31

import and then I can just go to results

play05:35

this is just an example CSV that I have

play05:37

right here this was kind of a bad spot

play05:39

to import it um let's undo that and

play05:41

import it here so we'll just get the

play05:43

same thing that we did last time we

play05:45

import it and you as you can see right

play05:47

here we imported uh the entire table and

play05:49

we can kind of navigate it as you'd

play05:51

expect and uh move things around as

play05:54

you'd expect um yeah and so this is kind

play05:58

of a nice way to kind of take like a CS

play05:59

V or a tsv like I mentioned here tab

play06:01

separated value and kind of import it as

play06:04

you did hopefully okay now we can get

play06:05

into the actual calculations which is

play06:07

one of the really cool things about org

play06:08

mode so there's a few different ways to

play06:11

enter them but we'll go through them one

play06:12

at a time so there's control equals

play06:14

which will let you enter a calculation

play06:16

for a column so right now uh this is

play06:18

pretty arbitrary but let's go ahead and

play06:20

just change this to 10 12 and then let's

play06:23

make this column some sort of a

play06:24

calculation so what we can do is we can

play06:26

do contrl C

play06:28

equals and then we can say that it is

play06:31

that this column is column one plus 10

play06:36

hit enter and it will apply that for the

play06:39

column if we go and remove that cuz that

play06:40

doesn't really matter there we go now we

play06:42

get the sort of calculation that you'd

play06:44

expect so each of these guys plus 10 and

play06:46

so the dollar sign is how you specify a

play06:49

row now you can also do an extra

play06:51

calculation say if you want to do

play06:53

control U contrl C equals then you can

play06:57

make it specific to the field and say

play06:59

let's just make this field equal to 10

play07:02

minus

play07:03

20 um which equals

play07:06

-10 um and as you can see they're all

play07:08

added down here into this table FM which

play07:11

I think is short for table format is

play07:13

kind of what they're going for and so

play07:14

this is kind of used to do some

play07:16

calculations and kind of just display

play07:17

the results up here now you can kind of

play07:20

uh recalculate them if you wanted to

play07:22

modify them so let's say move minus this

play07:24

to 10 and then we do contrl c contr c or

play07:28

if you want to just do it specific to a

play07:29

field you can do contrl c star which is

play07:31

useful but really these sort of General

play07:34

things I'm just showing off for the sake

play07:36

of it we'll get into some more advanced

play07:38

and actually useful uh ways to sort of

play07:40

modify these values in just a second so

play07:43

when we move on to references we

play07:44

actually get some really Advanced

play07:45

features and so this kind of makes the

play07:47

actual calculations a bit nicer so as

play07:49

you can see right down here I make a

play07:51

small reference to the second row in the

play07:54

second column remember that dollar sign

play07:57

indicates that this is the column and

play07:59

the at symbol indicates that this is a

play08:02

row now there's a few different ways

play08:04

that you can manipulate them as I

play08:05

mentioned here you can do contrl c uh

play08:07

quote single quote contrl C single quote

play08:12

will give you the current calculation so

play08:14

right now we have this set to calculate

play08:15

to one but we can instead say that we

play08:18

want to do plus and then let's say we

play08:21

want to do at one uh dollar sign two and

play08:25

so it will indicate where that is now

play08:27

instead let's like go ahead and change

play08:31

that to the right and then down and so

play08:35

now it will be one plus that entry and

play08:38

we can do contrl c contrl c to save that

play08:41

and there we go and when we recalculate

play08:42

it using contrl C control C you'll see

play08:44

that it is computed now just like before

play08:47

we can edit it once again and say maybe

play08:50

we want to uh change this to a 10 or 101

play08:55

I guess there we go we'll make it 10 and

play08:57

then contr C contr C and then and we can

play08:59

re-evaluate it I find this sort of a

play09:02

workflow to be much better than the uh

play09:04

one I talked about before um but it's

play09:06

most effective when you're using it with

play09:08

references I find now if you ever get

play09:10

confused you can do a contrl c uh curly

play09:13

brace this will kind of give you a bit

play09:15

of a layout and kind of breakdown of

play09:16

what you're looking at if you want to

play09:18

know what it is for one of the field you

play09:20

can do contrl c question mark and like I

play09:23

said before contrl c contrl c aligns

play09:25

things once again here's a little

play09:26

breakdown of how references work so at

play09:29

references a row the dollar sign

play09:30

references a column if you want to

play09:32

reference something say like very last

play09:34

element in a range and you can use the

play09:37

greater than symbol and then if you want

play09:39

to specify a range you can use two dots

play09:42

so here's a really good example now an

play09:44

alternative notation instead of having

play09:46

to control C quote or any of these other

play09:48

things you can actually just do a colon

play09:51

equals to enter in a calculation so here

play09:55

we're saying that we want the second row

play09:57

in the First Column so that's this guy

play09:59

all the way to the third row in the

play10:01

second column so we're selecting this

play10:04

region right here all right and so if I

play10:06

just hit tab boom that expands and we

play10:09

get the actual calculation and as you

play10:11

can see it's one right here if we go

play10:14

through you'll notice that it lines up

play10:15

with this one this guy this guy this guy

play10:17

and we created a range from that and as

play10:20

you can see that calculation ends up

play10:21

down here so this is a really quick way

play10:23

to just sort of write some quick

play10:25

shorthand if you just want to do like a

play10:26

quick calculation like we were talking

play10:28

about before like 10 + 20 tab you get

play10:32

the calculation kind of like what you'd

play10:33

expect now what if we want to reference

play10:36

other tables now this is a really

play10:38

awesome feature I use this all the time

play10:39

for the accounting stuff that I was

play10:40

talking about before so let's say we

play10:43

have uh some things and costs so we say

play10:45

that car costs x amount of money house

play10:47

costs x amount of money and so we could

play10:49

have some calculations down here but in

play10:51

this case we don't and then we can

play10:53

actually reference it so here we use

play10:55

remote to indicate that this is a

play10:56

reference we're referencing costs which

play10:58

comes from Up here we labeled this table

play11:00

as costs and then we're saying that we

play11:03

want the element right here all the way

play11:06

to this element which uh really is only

play11:08

two things that I could have said but I

play11:09

created a range from it so second row

play11:12

all the way to the third row both in the

play11:14

second column and then I am using vs sum

play11:16

to sum these results and as you can see

play11:19

right here if I um remove that or let's

play11:23

just remove that and recalculate it

play11:25

you'll see that the results align and we

play11:27

can sort of uh change this to

play11:30

and recalculate and we get the updated

play11:32

result now if you're wondering where uh

play11:35

all of the powers of adding subtracting

play11:37

and everything come from it's using a

play11:39

thing in emac called Kelk um which you

play11:41

guys can find in the info if I go ahead

play11:43

and take a look at it it's a stack-based

play11:45

calculator um it's very powerful I'm

play11:48

pretty sure it even has like Taylor

play11:49

series generation a bunch of different

play11:51

stuff like generating Graphics as you

play11:52

can see basically anything you see here

play11:54

arithmetic it can do linear algebra um

play11:57

it could do a lot of advanced math stuff

play11:58

that you guys can put in your tables

play12:00

obviously I don't take advantage of that

play12:01

all the time um but from time to time it

play12:03

can be super useful now when Kelk isn't

play12:05

enough this is when I reach out to org

play12:07

Babble org Babble is a way to sort of

play12:10

execute code from within an org file I

play12:13

haven't made a video on it but there's

play12:14

lots of videos out there for those of

play12:16

you interested um but there's pretty

play12:18

cool stuff that you can do with it so

play12:19

let's go ahead and do a really simple

play12:21

example using a table so the really

play12:23

simple one is just generating results so

play12:26

here I have a source block using python

play12:29

and I say return a uh list containing

play12:33

the values from zero all the way up to

play12:35

five and so if I hit control C control C

play12:38

to execute it I'll get a range of 0 1 2

play12:42

3 and four now we can also uh take data

play12:45

and pass it in so for example I have a

play12:48

table here I have named it note that I

play12:49

didn't use the table name this is just a

play12:52

generic name that we can use this is how

play12:54

you can label basically everything in

play12:55

org mode is using the hash plus name and

play12:59

so we named it messages and they're from

play13:01

and to somebody and then we actually

play13:03

take that and as you can see right here

play13:05

with VAR we're actually passing that in

play13:07

as a variable called data and we're

play13:10

actually using emac list this time not

play13:12

just python um so for those of you guys

play13:14

that don't have python installed very

play13:15

impressive that you don't have installed

play13:16

but uh you can actually do this with

play13:18

just regular emac list that will work

play13:20

everywhere um and so basically what I do

play13:23

here is I iterate over that data which

play13:26

we passed in up here and we go through

play13:28

and we go through each row and we print

play13:30

from Two and we get the first element

play13:33

that's given to us which is Jim and the

play13:35

second element which is John all right

play13:38

and so if we go ahead and execute that

play13:39

you'll see we get the results of from

play13:42

Jim to John from Tim to Drake from Griff

play13:45

to step uh questionable names there at

play13:48

the end hey just coming in to interrupt

play13:51

the video to talk about today's sponsor

play13:53

brilliant brilliant is an online

play13:55

learning platform when it comes to

play13:56

learning a lot of us jump to things like

play13:58

tutorials and lectures and really miss

play14:00

out on being able to absorb everything

play14:02

that we're being told this is where

play14:03

brilliant really stands out it gives you

play14:05

interactive real world examples that you

play14:07

can think through and problem solve and

play14:09

really retain the information that

play14:11

you're learning in this video I show you

play14:13

how you can use org tables and integrate

play14:15

them with different programming

play14:16

languages and interpreters if this is a

play14:18

New Concept to you I highly recommend

play14:20

taking a look at the computer science

play14:21

fundamentals course from them that goes

play14:23

a bit into the basic ideas of

play14:25

programming that a lot of new

play14:27

programmers can learn a lot from and you

play14:28

can start applying what we talk about at

play14:30

the end of this video in those Advanced

play14:31

features as you go if furthering your

play14:33

career knowledge or education interests

play14:35

you I highly recommend giving a look at

play14:37

brilliant to try everything brilliant

play14:40

has to offer now for free for a full 30

play14:42

days check out brilliant.org gaven

play14:45

freeorn first 200 of you will get 20%

play14:47

off brilliant's premium annual

play14:49

subscription once again thanks to

play14:50

brilliant for sponsoring this video okay

play14:52

so let's think of a practical

play14:53

application for those of us that do

play14:55

programming so in this case let's say we

play14:58

have a database and in this case I have

play15:00

one that is an SQL light database

play15:02

containing multiple restaurants so if I

play15:05

do contrl c contrl c we'll see that we

play15:07

can get the results like we were doing

play15:09

before as a table now this is a little

play15:12

messy so we can go sort of clean this up

play15:14

by executing this which will actually

play15:16

filter out by the important data now

play15:19

this is quite good and we can kind of

play15:20

like we were saying before manipulate

play15:22

these uh different guys as you'd expect

play15:24

so kind of adding a row removing a row

play15:27

if we want to filter down to maybe just

play15:29

like the location there you go now while

play15:31

exporting these results is useful

play15:33

sometimes you want to take them in as

play15:35

input so let's go ahead and do that with

play15:37

another SQL light database so we have a

play15:40

table right here it says Who and the

play15:42

task that they have we have two tasks

play15:44

for gaven that's me and then some other

play15:47

tasks for some other people now in this

play15:49

case I'm going to uh set a variable and

play15:53

we're going to set that variable to be

play15:54

called some data and it's going to take

play15:56

our table as we can see up here called

play15:59

test table uh and we do some extra

play16:00

settings I'm not really going to get dig

play16:02

into those and we say that the DB is

play16:04

just a temporary database that we'll be

play16:06

using and we'll say that we're going to

play16:07

drop this table if it already exists um

play16:09

just for this Demo's purpose and then we

play16:11

will import it and so now if we contrl C

play16:14

control C on this we will see that it's

play16:16

able to select who and task where the

play16:18

who is Gavin and so as you can see right

play16:20

here it selected just the ones that were

play16:22

tasks for me now just to prove that I'm

play16:24

not making this up we can go ahead and

play16:25

use emac to actually open this and if if

play16:29

we open up the database you can see that

play16:31

it's all the original data that we

play16:32

originally entered in you can do a lot

play16:34

of this stuff with basically any SQL

play16:36

light database um as well as any SQL in

play16:40

general database um there's a bunch of

play16:42

information both these links that you

play16:44

can find in these show notes and finally

play16:45

we'll move on to another Advanced

play16:48

feature using the org Babel integration

play16:50

um so this is a bit more of a breakdown

play16:52

of what's going on here so in this case

play16:54

we're going to use the r programming

play16:55

language to do some mathematical stuff

play16:57

do note that the ES s package is what's

play16:59

used to give us our source code

play17:02

functionality once you have the ESS

play17:04

package installed you can also set up

play17:06

the org Babble functionality for R by

play17:09

just uh executing this eisp and here

play17:12

let's go ahead and dig into it so here

play17:13

we have a table which has each month of

play17:15

the year and then what the temperature

play17:18

was and so we can kind of plot this out

play17:20

so here we're going to once again take

play17:22

that table up there turn it into Data

play17:25

we're going to say that our results will

play17:26

be a graphical file we'll say that that

play17:28

file is going to be a PNG um and that

play17:30

way we will export it I think that's

play17:32

what the exports was I can't actually

play17:33

remember what I entered that part in for

play17:34

we'll plot it and then we give it a

play17:36

legend for the plot and we can hit crl c

play17:38

contrl c and then you can use as I

play17:41

mentioned down here contrl C CR x contrl

play17:43

v to preview it and as you can see we

play17:46

generated a very nice graph um to get

play17:49

the data that we wanted I know that gnu

play17:51

plot also can do this sort of stuff but

play17:53

if you guys wanted to do statistics and

play17:54

stuff um R is there and you can use

play17:57

something like gnu octave if you wanted

play18:00

to do uh linear algebra that maybe Kel

play18:02

can't do um or anything like that

play18:05

there's a lot of functionality out there

play18:06

if this interest you guys uh be sure to

play18:08

check out simx I think that's how they

play18:10

expect you to pronounce it um which is

play18:12

basically an emac setup meant for uh

play18:15

scientists and Engineers um which is

play18:17

really cool I've looked at that in the

play18:19

past obviously for me it doesn't really

play18:20

make sense because I'm so used to emac

play18:22

but uh for those of you that aren't it

play18:23

might be a very interesting starting

play18:25

point so where does this functionality

play18:26

leave us well in the end we have quite a

play18:29

lot of power that we can use to automate

play18:31

our lives do things like Financial

play18:33

calculations daily life calculations

play18:36

very advanced stuff for maybe generating

play18:38

a graph or a plot if you guys want to

play18:40

learn more about how I use it maybe how

play18:42

I do some of my finances um and maybe

play18:44

some more advanced features that you can

play18:45

do with org mode and tables be sure to

play18:48

let me know down in the comments now

play18:49

before I let you all go I wanted to give

play18:51

a big shout out to my supporters on

play18:53

patreon and GitHub sponsors you guys

play18:55

mean the world to me and you guys have

play18:56

done so much to support the channel and

play18:58

kind of keep keep things going uh in

play19:00

between sponsors which I really

play19:03

[Music]

play19:09

appreciate

Rate This

5.0 / 5 (0 votes)

関連タグ
Org ModeTable FeaturesData ManipulationSpreadsheetEmacs EditorCalculation EngineProgramming IntegrationFinance ToolsProductivity HacksEducational ContentTechnical Tutorial
英語で要約が必要ですか?