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 ...

Navigating the Return-to-Office Trend

Balancing Corporate Mandates, Employee Realities, and Data-Driven Insights In the post-pandemic era, the workplace landscape is shifting once again. Major companies like Amazon, JPMorgan Chase, Dell, Apple, and Google are increasingly enforcing return-to-office (RTO) mandates—arguing that in-person work is essential for collaboration, culture, and career growth. Yet, many employees, who have thrived with remote or hybrid work, are resisting these changes. In this post, we explore the contrasting philosophies driving these mandates, juxtapose them with firsthand employee experiences and data from our recent report on remote and hybrid work experiences, and discuss why a balanced, flexible hybrid future may be the key. The Corporate Push for Return-to-Office Top executives are doubling down on the belief that the office is the crucible of innovation. For example: Amazon’s CEO Andy Jassy has mandated that starting in 2025, all corporate staff must return to the office five days a we...