Combining CSV Files and Verifying Line Count

1500 .csv files bogging down an import system due to the number of files.

Combine files into 1 file.

Problem #1:
All files have a header row with field names.

Solution #1:
Combine all the files while stripping off the

find . -name "*.csv" | xargs -n 1 tail -n +2 > big.csv

Problem #2:
I’m not sure if I have all the lines I should.

Solution #2:
Verify number of lines in the file and compare to row count from a database.

sed -n '$=' big.csv

Problem #3:
This removed the header row that I need at the very top of the file.

Solution #3:
Create file (header.csv) with a single line containing the field names that we stripped off earlier.
Then take header and big and combing them into our final csv file:

cat header.csv big.csv > final.csv


A Vision for Teaching Children

FeaturedA Vision for Teaching Children

Originally published 2/24/2014, updated 10/1/2020, 12/13/2022

To instill a lifelong love of learning.

By encouraging curiosity, question-asking and interruptions.

By setting up fences and borders for the learning experience
wide enough to never be noticed.

Because gentle guidance keeps a student approximately in the center
of their thousand-mile-wide educational experience.

With the use of goals and results as a way to measure success
not of the student, and not of the teacher
but of the approach used to teach
and for the purpose of celebrating successes.

With a strong focus on the individual student’s learning style
so their curious nature is not crushed
and their intellectual boundaries are not artificially limited
through the drive to achieve arbitrary results
to satisfy a pointless numerical goal
that has nothing to do with actual intelligence or learning.

Understanding that the result of a fully engaged student
who has been taught to love learning
who has been allowed to ask unrelated questions
who has never heard, “you are special” nor “you are ignorant”
(despite being both)
and who has been carefully guided without visible boundaries

Will be a person who will produce amazing results
who will never stop learning
who will never know any intellectual limits
who will be able to create anything
and will never cease to amaze the world.

Photo by Belinda Fewings