Giter Club home page Giter Club logo

hw_4's Introduction

Shell Loop Exercise

Problem: Dr. Hessl asked Cynthia to download all the tree ring data for the US from the International Tree Ring Data Bank (ITRDB) and provide a summary of the data available to compare to Cynthia's dissertation data. Cynthia is smart and has decided to solve the problem for WV first.

ITRDB files have a lot of metadata in the headers, but not all files have them and they are not always formatted the same way. To help her get started summarizing the available data, Cynthia wants to know which files have headers and which do not.

Data: Accessible as text files from NOAA Maintained International Tree Ring Data Bank https://www1.ncdc.noaa.gov/pub/data/paleo/treering/measurements/northamerica/usa/

Objective: Write a set of commands for the bash shell that successfully:

  1. Downloads all the .rwl files for WV from the NOAA website.
  2. Creates a file called sitename.txt that is a list of the site names each followed by the first line of each file, which is often but not always a header with metadata, such as for wv004:
wv004
NERI   1 New River Gorge                                     PIVI  

Follow the following principles:

  1. Be sure to make the paths absolute so that I can reproduce the structure on my machine simply by running your code.
  2. Code should be saved as part of a .md file
  3. Code blocks include only commands
  4. Comments are made around the text block in well-formatted markdown.
  5. The fewer lines of code, the better the answer. Edit your answer until only what is required is present. 8 lines or less is possible.

Hints/Tips:

Use wget combined with a wildcard to get all the .rwl files for a state Loop through those files to extract the header using cut and head

Submit using the fork-clone-branch-commit-pull_request strategy.

hw_4's People

Contributors

ahessl avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.