FITFLOP
Home

awk (25 post)


posts by category not found!

replace text in html with sed or awk

How to Replace Text in HTML with sed or awk When working with HTML files you might encounter situations where you need to replace specific text or tags Command

2 min read 21-10-2024 24
replace text in html with sed or awk
replace text in html with sed or awk

awk - pattern replace and split only by first occurrence of seperator

Understanding Awk Pattern Replacement and Splitting by First Occurrence of a Separator Awk is a powerful text processing tool that allows users to manipulate an

3 min read 20-10-2024 27
awk - pattern replace and split only by first occurrence of seperator
awk - pattern replace and split only by first occurrence of seperator

Find and replace while preserving case with sed

Finding and Replacing Text with Case Sensitivity Using sed The Challenge Sometimes we need to replace a specific word in a file while maintaining its original c

2 min read 07-10-2024 40
Find and replace while preserving case with sed
Find and replace while preserving case with sed

using awk print all lines starting with `* foo` to any following line that starts with `* `

Extracting Blocks of Text Starting with foo using awk Lets say you have a text file and you want to extract all lines starting with foo and all subsequent lines

2 min read 06-10-2024 59
using awk print all lines starting with `* foo` to any following line that starts with `* `
using awk print all lines starting with `* foo` to any following line that starts with `* `

Add prefix to git commit message using LazyGit custom command

Adding Prefixes to Your Git Commit Messages with Lazy Gits Custom Commands Lazy Git a powerful terminal based Git GUI offers a fantastic way to manage your repo

2 min read 05-10-2024 30
Add prefix to git commit message using LazyGit custom command
Add prefix to git commit message using LazyGit custom command

awk/sed to get a particular field extracted

Extracting Specific Fields with awk and sed A Practical Guide Extracting specific data from a text file is a common task in data processing and scripting While

2 min read 04-10-2024 34
awk/sed to get a particular field extracted
awk/sed to get a particular field extracted

sed/awk expression to prepend text and append increasing numbers to list

Prepending Text and Appending Numbers to a List with sed and awk Lets say you have a list of items in a file and you need to add some text before each item and

2 min read 04-10-2024 34
sed/awk expression to prepend text and append increasing numbers to list
sed/awk expression to prepend text and append increasing numbers to list

awk command to replace block between two tags with contents of variable

Replacing Blocks Between Tags with awk A Powerful Text Manipulation Technique Have you ever needed to replace a specific section of text within a file enclosed

2 min read 04-10-2024 47
awk command to replace block between two tags with contents of variable
awk command to replace block between two tags with contents of variable

ls to show only date modified, time modified, and name

Displaying Only Date Time and Name with ls Lets say you re working on a project and need to quickly see the last modified date time and name of files within a d

2 min read 04-10-2024 23
ls to show only date modified, time modified, and name
ls to show only date modified, time modified, and name

Full join - bash

The Quest for a Full Join in Bash Combining Data with a Twist You ve got two files brimming with data and you need to merge them together including all rows fro

2 min read 03-10-2024 27
Full join - bash
Full join - bash

Remove duplicate lines from 2 files

How to Remove Duplicate Lines from Two Files A Comprehensive Guide Scenario You have two files lets call them file1 txt and file2 txt and you need to remove dup

2 min read 03-10-2024 27
Remove duplicate lines from 2 files
Remove duplicate lines from 2 files

awk merging files where col value is in range

Merging Files Based on Column Value Ranges with awk Lets say you have two files file1 txt and file2 txt and you want to merge them based on a specific column va

2 min read 03-10-2024 43
awk merging files where col value is in range
awk merging files where col value is in range

`uniq` without sorting an immense text file?

Finding Unique Lines in a Massive Text File Beyond uniq Lets face it processing gigabytes of text data can be a challenge Imagine you have a massive text file p

2 min read 03-10-2024 28
`uniq` without sorting an immense text file?
`uniq` without sorting an immense text file?

How to remove duplicates based on column1 and conditions in column3?

How to Remove Duplicates Based on Column 1 and Conditions in Column 3 A Practical Guide Often you ll encounter datasets where you need to remove duplicates base

2 min read 02-10-2024 36
How to remove duplicates based on column1 and conditions in column3?
How to remove duplicates based on column1 and conditions in column3?

Fill column with longest value for each repeated element

Filling a Column with the Longest Value for Repeated Elements in a Data Frame Lets say you have a Data Frame where certain values appear multiple times in one c

2 min read 02-10-2024 32
Fill column with longest value for each repeated element
Fill column with longest value for each repeated element

Why my bash script works in the terminal but fails in a script with a function involved and ssh call?

Why Your Bash Script Works in the Terminal but Fails in a Function with SSH Calls Have you ever encountered a frustrating situation where your Bash script runs

2 min read 02-10-2024 29
Why my bash script works in the terminal but fails in a script with a function involved and ssh call?
Why my bash script works in the terminal but fails in a script with a function involved and ssh call?

Count the number of lines and characters in a file separated by a specific character

Counting Lines and Characters in a File A Comprehensive Guide Have you ever needed to know the exact number of lines and characters in a file especially when de

2 min read 01-10-2024 43
Count the number of lines and characters in a file separated by a specific character
Count the number of lines and characters in a file separated by a specific character

awk confuse columns when printing tabulated files

Awk Confusion When Columns Go Astray in Tabulated Files Working with tabulated data is a common task for many programmers and the awk command is a powerful tool

2 min read 01-10-2024 31
awk confuse columns when printing tabulated files
awk confuse columns when printing tabulated files

how to capture filename along with space in bash when operating with git diff

Capturing Filenames with Spaces in Git Diff with Bash When working with Git you might encounter situations where you need to extract the names of modified files

2 min read 01-10-2024 44
how to capture filename along with space in bash when operating with git diff
how to capture filename along with space in bash when operating with git diff

awk throwing syntax error only when used as alias

Awk Syntax Error Why Aliases Can Cause Trouble Have you ever encountered a baffling syntax error when using awk through an alias but the same command works perf

2 min read 01-10-2024 34
awk throwing syntax error only when used as alias
awk throwing syntax error only when used as alias

File header is not being processed by awk in bash loop

awk ing at a File Header Why Your Bash Loop Might Be Skipping It Imagine you re working with a data file and you want to process each line using awk But for som

2 min read 30-09-2024 30
File header is not being processed by awk in bash loop
File header is not being processed by awk in bash loop

How to extract sequence from a fastq file and save as new file for each sequence

Extracting Sequences from a FASTQ File A Comprehensive Guide FASTQ files are the standard format for storing sequencing reads containing both nucleotide sequenc

2 min read 30-09-2024 33
How to extract sequence from a fastq file and save as new file for each sequence
How to extract sequence from a fastq file and save as new file for each sequence

linux command to coalesce repeated entries in output

Conquering Redundancy Coalescing Repeated Entries in Linux Output Lets face it dealing with repetitive information in Linux output can be a real pain Imagine a

2 min read 30-09-2024 30
linux command to coalesce repeated entries in output
linux command to coalesce repeated entries in output

AWK equivalent to `read -r _ _ remainder`

Simulating read r remainder in AWK Parsing Input Lines Effectively The read r remainder command in Bash is a handy tool for parsing input lines It reads a line

2 min read 30-09-2024 38
AWK equivalent to `read -r _ _ remainder`
AWK equivalent to `read -r _ _ remainder`

AWK command to process output from a script

Harnessing the Power of AWK Processing Script Output with Grace Have you ever found yourself staring at a wall of text output from a script struggling to extrac

2 min read 29-09-2024 48
AWK command to process output from a script
AWK command to process output from a script