You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: episodes/02-match-extract-strings.md
+4-14
Original file line number
Diff line number
Diff line change
@@ -21,7 +21,7 @@ exercises: 30
21
21
22
22
For this exercise, open a browser and go to [https://regex101.com](https://regex101.com). Regex101.com is a free regular expression debugger with real time explanation, error detection, and highlighting.
23
23
24
-
Open the [swcCoC.md file](https://github.com/LibraryCarpentry/lc-data-intro/tree/gh-pages/data/swcCoC.md), copy the text, and paste that into the test string box.
24
+
Open the [swcCoC.md file](https://github.com/LibraryCarpentry/lc-data-intro/tree/main/episodes/data/swcCoC.md), copy the text, and paste that into the test string box.
25
25
26
26
For a quick test to see if it is working, type the string `community` into the regular expression box.
27
27
@@ -139,7 +139,7 @@ Find all of the words starting with Comm or comm that are plural.
139
139
140
140
For this exercise, open a browser and go to [https://regex101.com](https://regex101.com).
141
141
142
-
Open the [swcCoC.md file](https://github.com/LibraryCarpentry/lc-data-intro/tree/gh-pages/data/swcCoC.md), copy it, and paste it into the test string box.
142
+
Open the [swcCoC.md file](https://github.com/LibraryCarpentry/lc-data-intro/tree/main/episodes/data/swcCoC.md), copy it, and paste it into the test string box.
143
143
144
144
::::::::::::::::::::::::::::::::::::::: challenge
145
145
@@ -253,8 +253,6 @@ Start with what we know, which is the most basic format of a phone number: three
253
253
254
254
This expression should find three matches in the document.
@@ -361,7 +353,7 @@ This expression should find one match in the document.
361
353
362
354
### Using regular expressions when working with files and directories
363
355
364
-
One of the reasons we stress the value of consistent and predictable directory and filenaming conventions is that working in this way enables you to use the computer to select files based on the characteristics of their file names. For example, if you have a bunch of files where the first four digits are the year and you only want to do something with files from '2017', then you can. Or if you have 'journal' somewhere in a filename when you have data about journals, you can use the computer to select just those files. Equally, using plain text formats means that you can go further and select files or elements of files based on characteristics of the data *within* those files. See Workshop Overview: [File Naming \& Formatting](https://librarycarpentry.org/lc-overview/06-file-naming-formatting/index.html) for further background.
356
+
One of the reasons we stress the value of consistent and predictable directory and filenaming conventions is that working in this way enables you to use the computer to select files based on the characteristics of their file names. For example, if you have a bunch of files where the first four digits are the year and you only want to do something with files from '2017', then you can. Or if you have 'journal' somewhere in a filename when you have data about journals, you can use the computer to select just those files. Equally, using plain text formats means that you can go further and select files or elements of files based on characteristics of the data *within* those files. See Workshop Overview: [File Naming \& Formatting](https://librarycarpentry.org/lc-overview/06-file-naming-formatting) for further background.
@@ -371,7 +363,7 @@ One of the reasons we stress the value of consistent and predictable directory a
371
363
372
364
### Extracting a substring in Google Sheets using regex
373
365
374
-
1. Export and unzip the [2017 Public Library Survey](https://github.com/LibraryCarpentry/lc-data-intro/blob/gh-pages/files/PLS_FY17.zip) (originally from the IMLS data site) as a CSV file.
366
+
1. Export and unzip the [2017 Public Library Survey](https://github.com/LibraryCarpentry/lc-data-intro/blob/main/episodes/files/PLS_FY17.zip) (originally from the IMLS data site) as a CSV file.
375
367
2. Upload the CSV file to Google Sheets and open as a Google Sheet if it does not do this by default.
376
368
3. Look in the `ADDRESS` column and notice that the values contain the latitude and longitude in parenthesis after the library address.
377
369
4. Construct a regular expression to match and extract the latitude and longitude into a new column named 'latlong'. HINT: Look up the function `REGEXEXTRACT` in Google Sheets. That function expects the first argument to be a string (a cell in `ADDRESS` column) and a quoted regular expression in the second.
@@ -388,8 +380,6 @@ This is one way to solve this challenge. You might have found others. Inside the
388
380
389
381
Latitude and longitude are in decimal degree format and can be positive or negative, so we start with an optional dash for negative values then use `\d+` for a one or more digit match followed by a period `\.`. Note we had to escape the period using `\`. After the period we look for one or more digits `\d+` again followed by a literal comma `,`. We then have a literal space match followed by an optional dash `-` (there are few `0.0` latitude/longitudes that are probably errors, but we'd want to retain so we can deal with them). We then repeat our `\d+\.\d+` we used for the latitude match.
Copy file name to clipboardExpand all lines: index.md
+1-3
Original file line number
Diff line number
Diff line change
@@ -9,8 +9,7 @@ This Library Carpentry lesson introduces people with library- and information-re
9
9
10
10
## Teaching this lesson
11
11
12
-
This lesson is taught either as a combination with the episodes [Jargon Busting](https://librarycarpentry.org/lc-overview/03-jargon-busting/index.html) and [A Computational Approach](https://librarycarpentry.org/lc-overview/04-computational-approach/index.html) in [Workshop Overview](https://librarycarpentry.org/lc-overview/) (with the possibility of adding optional episodes from Workshop Overview), as part of a self-organised mix-and-match training, or separately as an individual lesson.
13
-
12
+
This lesson is taught either as a combination with the episodes [Jargon Busting](https://librarycarpentry.org/lc-overview/03-jargon-busting) and [A Computational Approach](https://librarycarpentry.org/lc-overview/04-computational-approach) in [Workshop Overview](https://librarycarpentry.org/lc-overview/) (with the possibility of adding optional episodes from Workshop Overview), as part of a self-organised mix-and-match training, or separately as an individual lesson.
Copy file name to clipboardExpand all lines: instructors/instructor-notes.md
+2-2
Original file line number
Diff line number
Diff line change
@@ -18,11 +18,11 @@ To make a handout for this lesson, adapt/print from [https://librarycarpentry.or
18
18
19
19
To teach regular expressions, instructors have used:
20
20
21
-
-[slides](https://github.com/LibraryCarpentry/lc-data-intro/blob/gh-pages/files/regexslides.pdf) to quiz the audience on examples.
21
+
-[slides](https://github.com/LibraryCarpentry/lc-data-intro/blob/main/episodes/files/regexslides.pdf) to quiz the audience on examples.
22
22
- Pen and paper, to work through exercises before using a tool and to explain that there can be multiple answers to the same question.
23
23
- Whiteboard with text examples and quized participants on regex approaches.
24
24
- Online tools such as: [Regxr](https://regexr.com/), [regex101](https://regex101.com/), [rexegper](https://regexper.com/), [myregexp](https://myregexp.com/), or whichever service you prefer.
25
-
- Used quiz/exercise files in [https://github.com/LibraryCarpentry/lc-data-intro/tree/gh-pages/files](https://github.com/LibraryCarpentry/lc-data-intro/tree/gh-pages/files).
25
+
- Used quiz/exercise files in [episodes/files](https://github.com/LibraryCarpentry/lc-data-intro/tree/main/episodes/files).
0 commit comments