Skip to content

Instantly share code, notes, and snippets.

View irenecasado's full-sized avatar

Irene Casado Sánchez irenecasado

View GitHub Profile
@irenecasado
irenecasado / ca_failed_banks.sh
Last active January 31, 2022 00:47
ca_failed_banks.sh
mkdir -p
cd code
curl -s --output banklist.csv https://www.fdic.gov/resources/resolutions/bank-failures/failed-bank-list/banklist.csv
touch ca_failed_banks.csv
head -1 banklist.csv
head -1 banklist.csv > ca_failed_banks.csv
cat ca_failed_banks.csv
grep CA banklist.csv >> ca_failed_banks.csv
ROW_COUNT=`wc -l < ca_failed_banks.csv | xargs`
NUM_BANKS=$(($ROW_COUNT - 1))
animals = ['cat', 'dog', 'canary', 'chihuahua', 'narwhal']
filtered_animals = []
for animal in animals:
if animal.startswith('c'):
print(animal.upper())
filtered_animals.append(animal)
print('Number of C-animals: '+str(len(filtered_animals)))
~> mkdir code
~> cd code
~/code> curl -s --output banklist.csv https://www.fdic.gov/resources/resolutions/bank-failures/failed-bank-list/banklist.csv
~/code> touch ca_failed_banks.csv
~/code> head -1 banklist.csv
Bank Name�,City�,State�,Cert�,Acquiring Institution�,Closing Date�,Fund
~/code> head -1 banklist.csv > ca_failed_banks.csv
~/code> cat ca_failed_banks.csv
~/code> grep CA banklist.csv >> ca_failed_banks.csv
~/code> ROW_COUNT=`wc -l < ca_failed_banks.csv | xargs`