Skip to main content

Shell Script - Filter / Extract Lines {Quick & Dirty}

Hey!

Recently ran into a unique problem - had a csv file that was too large to open! 

Well technically.....it opened....but.....all of the data couldn't be displayed. Then I remembered I had a linux box I use for exactly this type of thing! 

Whipped up a quick & dirty script below. It reads the entire csv file, matches the lines that meet the specified criteria, and writes those line items into a new csv file. 

May not be the best or most efficient, but it works.


See script below:

#!/bin/bash

input_file="data.csv"

output_file="filtered.csv"

# Print header and then matching lines

(head -n 1 "$input_file" && grep "Call Data" "$input_file") > "$output_file"

echo "Done. Header and matched lines saved to $output_file."


Remember... chmod +x 

Comments

Popular posts from this blog

How I Used ChatGPT’s Voice Feature to Level Up My Spanish Speaking

Learning a language can sometimes feel like wandering in the dark—especially when you don’t have someone beside you pointing out missteps or celebrating small victories. Last year, I discovered a game-changer: ChatGPT’s built-in voice feature. In this post, I’ll walk you through how I used voice interactions with ChatGPT to evaluate my Spanish speaking level, share the feedback I received, and give practical tips for fellow B1–B2 learners who want to take their oral skills to the next level. Why I Turned to AI Voice Chat for Language Practice By April 2025, I’d already spent months studying Spanish through apps and textbooks, but I still felt stuck at a plateau. My writing and comprehension were decent, but as soon as I tried to speak fluidly—especially beyond simple topics—I hesitated, stumbled over the subjunctive, and felt my vocabulary desert me. I needed real-time conversation practice, plus objective feedback on pronunciation, fluency, and grammar—exactly what an official DELE ...

Level Up Your Language Game: From Solid B2 to That Elusive C1 (Inspired by Luca & David)

For someone like me, who's been geeking out over language learning for ages (seriously, I've been a Luca Lampariello YouTube subscriber for like, a decade!), this B1/B2-to-C1 jump is something I've seen and thought about a lot. And recently, Luca got together with another smart cookie, David, for a really insightful chat on YouTube ( seriously, go check it out when you get a chance ). They broke down exactly what that leap entails, and honestly, it all just clicked. B1 / B2: You're Doing Great, But There's More to the Story Think of B2 as that solid foundation. You can get by, you can express your needs, and you're probably feeling pretty confident in most everyday situations. As David put it in the video, it's about "survival and function." You're not just scraping by; you're actually using the language. But C1? That's where things get really interesting. It's not just about knowing a bigger pile of words. It's about this subtl...