mirror of
https://github.com/quatalog/quatalog.git
synced 2024-11-08 08:04:24 +00:00
add header to csv
This commit is contained in:
parent
9b877abe66
commit
9ec4198155
3
.github/workflows/scraper.yml
vendored
3
.github/workflows/scraper.yml
vendored
|
@ -144,12 +144,13 @@ jobs:
|
||||||
|
|
||||||
- name: Create CSV file
|
- name: Create CSV file
|
||||||
run: |
|
run: |
|
||||||
|
echo '"Instructor","Course"' > quatalog-data/courses.csv
|
||||||
cd static-generated/courses
|
cd static-generated/courses
|
||||||
grep -oe '<li>.*</li>' *.html |
|
grep -oe '<li>.*</li>' *.html |
|
||||||
sort -u |
|
sort -u |
|
||||||
grep -ve "-[0-9]9[4-7][0-9]" -e "-[0-9]9[89]0" -e "-[0-9]00[1-9]" -e "USA[RF]" -e "ADMN" -e "USNA" |
|
grep -ve "-[0-9]9[4-7][0-9]" -e "-[0-9]9[89]0" -e "-[0-9]00[1-9]" -e "USA[RF]" -e "ADMN" -e "USNA" |
|
||||||
sed -e 's/^/"/' -e 's/.html:<li>/","/' -e 's#</li>#"#' -e 's/"\([^"]*\)","\([^"]*\)"/"\2","\1"/' |
|
sed -e 's/^/"/' -e 's/.html:<li>/","/' -e 's#</li>#"#' -e 's/"\([^"]*\)","\([^"]*\)"/"\2","\1"/' |
|
||||||
sort > ../../quatalog-data/courses.csv
|
sort >> ../../quatalog-data/courses.csv
|
||||||
|
|
||||||
- name: Push CSV file
|
- name: Push CSV file
|
||||||
working-directory: quatalog-data
|
working-directory: quatalog-data
|
||||||
|
|
Loading…
Reference in a new issue