Skip to content

Magenaut

  • Home
  • Topics
    • Notes
    • Tutorial
    • Bug fixing
    • Extension
    • Server
  • Q&A
  • Privacy Policy
  • About

awk

Insert text from file inline after matching pattern in another file

August 11, 2022 by Magenaut

I’m trying to take the contents of a file and insert it after a matching pattern in another file using sed. My question is very similar to this question, but I wish to insert the contents of a file inline rather than on a new line. How can I do this?

Categories Q&A, Unix & Linux Tags awk, sed, text-processing Leave a comment

Splitting a file into multiple files based on 1st column value

August 11, 2022 by Magenaut

-F| sets the field separator to |.

Categories Q&A, Unix & Linux Tags awk, text-processing Leave a comment

When to use grep, less, awk, sed

August 11, 2022 by Magenaut

I’m entering the world of Linux and at work I’m using grep more and more. By doing that I’m figuring out that sometimes it’s not adequate for what I want. I was struggling with grep a few days ago and a colleague of mine who is a senior Linux admin, told me to use awk. … Read more

Categories Q&A, Unix & Linux Tags awk, grep, less, sed Leave a comment

Is there a basic tutorial for grep, awk and sed?

August 10, 2022 by Magenaut

I’ve been a Linux user for a while, and I’ve a pretty decent understanding of most the common command line utilities. However, ones that come up and up again in relation to programming are grep, awk, and sed. About the only thing I’ve used grep for is piping stuff into it to find files in … Read more

Categories Q&A, Unix & Linux Tags awk, grep, sed Leave a comment

How to split a file according to a column (including header) and rename the generated files?

August 10, 2022 by Magenaut

I have a .txt that can be exemplified like this:

Categories Q&A, Unix & Linux Tags awk, text-processing Leave a comment

How to read first and last line from cat output?

August 10, 2022 by Magenaut

I have text file. Task – get first and last line from file after

Categories Q&A, Unix & Linux Tags awk, bash, grep, sed, shell Leave a comment

Removal of lines with no more or fewer than ‘N’ fields?

August 10, 2022 by Magenaut

I am working on mac with sed, perl, awk, bash..

Categories Q&A, Unix & Linux Tags awk, columns, sed, text-processing Leave a comment

Count distinct values of a field in a file

August 10, 2022 by Magenaut

I have a file with one million lines. Each line has a field called transactionid, which has repetitive values. What I need to do is to count them distinctly. No matter how many times a value is repeated, it should be counted only once.

Categories Q&A, Unix & Linux Tags awk, text-processing Leave a comment

Replace strings in a file based on a list of strings and a list of corresponding replacements

August 10, 2022 by Magenaut

I am trying to replace strings in a file A:

Categories Q&A, Unix & Linux Tags awk, perl, sed, text-processing Leave a comment

Add thousands separator in a number

August 10, 2022 by Magenaut

In python

Categories Q&A, Unix & Linux Tags awk, bash, shell-script, string Leave a comment
Older posts
Newer posts
← Previous Page1 Page2 Page3 … Page9 Next →
  1. michealSmith07 on Is there a way to dynamically refresh the less command?August 21, 2022

    That is a very nice post. I like this post.

  2. anonymous on Fix libwacom9 dependency issue when upgrade DebianJune 27, 2022

    saved my day!! Thanks for the help…

  3. sreedhar on Fix libwacom9 dependency issue when upgrade DebianMay 10, 2022

    Thanks its working

  4. saintnick on Fix libwacom9 dependency issue when upgrade DebianMay 10, 2022

    remove libwacom2 worked for me as well

  5. ranafoul on Fix libwacom9 dependency issue when upgrade DebianApril 22, 2022

    apt remove libwacom2 helped on kali 2022.01. gr8

.net ajax asp.net asp.net-core asp.net-mvc asp.net-mvc-3 asp.net-mvc-4 asp.net-web-api bash c# command-line css custom-post-types custom-taxonomy dataframe dictionary django entity-framework functions gridview html iis javascript jquery json linux list matplotlib numpy pandas php plugin-development plugins posts python python-2.7 python-3.x security shell shell-script sql string vb.net webforms wp-query

© 2026 Magenaut • Built with GeneratePress