owned this note
owned this note
Published
Linked with GitHub
# lesson dev: Creating and modifying text files on remote computers (remote computing 2021)
[github issue](https://github.com/ngs-docs/2021-august-remote-computing/issues/2)
## what needs to be done
the basic lesson needs to be developed :)
but we need to do some scoping.
and probably want to sketch out learning outcomes.
as well as pre-, post-, and in-lesson formative assessment.
can we find a big open access text file to play with? perhaps tale of two cities? and talk about "too big to open", and also navigating through such files.
and of course "what do binary files look like" etc. can do that by transforming said large text file, I guess.
### discussion of scope
we'll be running this in binder, so we'll have access to RStudio editor as well as command-line editors. I'm thinking to show people RStudio editor, pico/nano, vim (and how to exit), and maybe emacs (how to exit :)? can also refer to / talk about notepad++ and ed, and maybe a Mac OS X remote editor? (see answers to [my twitter inqury](https://twitter.com/ctitusbrown/status/1421102631557025796).)
we'll have to be careful to show people about overwriting etc. "never edit files in multiple places, although most editors will detect and warn." add something about multiple windows here. so that's maybe a "hey, just so you know, here's what not to do" section at the end of the first hour.
probably also worth discussing "local" vs "remote" here, as an extension of first lesson.
### one possible structure
section 1: intro and concepts
* hello and welcome
* remote computing intro/reprise
* how computers work intro/reprise
section 2: core topic, editing text files remotely
* mostly matters *that text gets there*
* text is different from Word, binary files
* can always _look_ at text files with cat, more/less, tail, head, grep - unix is designed around them
* example of binary files - zip, gz, and programs. (von neumann architecture)
* examples of text files you might encounter in the wild: random text files, CSV, scripts, config files, sequence files (in biology)
* text files can be structured, e.g. CSV, but then it's up to the reading program to care about the structure. this is generally true in UNIX.
* (maybe talk about csvtk here?)
* basically, many things in UNIX are text files
* so key question is, how do we edit them?
* show a few things in RStudio editor, show how what you do there is reflected in the shell
* that's what it boils down to!
section 3: slightly more advanced text editing
* in practice, a few problems.
* files can be big
* files may be _remote_ without RStudio or other immediate editor access
* (we'll talk about how to talk to remote things next time!)
* it can be slow and annoying to configure access to remote files
* so really there are three types of editors: ones you run locally, ones you run over remote connection, and ones you run remotely.
* the latter are hardest to use but (for historical reasons) very common
* the former are easiest to use but hardest to set up (can't actually demo)
* the middle ones are easy to use but you can't always set them up
* so let's use pico instead of rstudio editor
* note changes are reflected!! (check if/how rstudio updates when file is edited underneath?)
section 4: what are your options for editing?
* remote UNIX editors:
* pico/nano
* vim
* emacs
* ed (just how to exit :)
* cat (as a reductive example)
* local editors: OS dependent
* windows: vscode, notepad++
* mac os x: vscode, bbedit
* web editors
* RStudio
* JupyterLab
section 5: concluding thoughts
take step back, talk about initial remote/local dichotomy
what we've shown you is...
these skills will become second nature if you use them, bcause they are foundational to everything
you always want to know at least one local editor, I suggest learning vim
what you use other than that is up to you and your prefs - pepole really like the windows/mac os x software above.
missing stuff:
* how to use gunzip and zip should go in here somewhere
* maybe 'file' command
* text encodings/unicode?