Skip to content

Magenaut

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

text-processing

Text processing – join every two lines with commas

August 11, 2022 by Magenaut

I have more than 1000 lines in a file. The file starts as follows (line numbers added):

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

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

Decoding URL encoding (percent encoding)

August 11, 2022 by Magenaut

I want to decode URL encoding, is there any built-in tool for doing this or could anyone provide me with a sed code that will do this?

Categories Q&A, Unix & Linux Tags sed, shell-script, text-processing, url Leave a comment

How to cut (select) a field from text line counting from the end?

August 11, 2022 by Magenaut

I know how to select a field from a line using the cut command. For instance, given the following data:

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

Is there a way to get the min, max, median, and average of a list of numbers in a single command?

August 10, 2022 by Magenaut

I have a list of numbers in a file, one per line. How can I get the minimum, maximum, median and average values? I want to use the results in a bash script.

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

Grep word within a file then copy the file

August 10, 2022 by Magenaut

I have a collection of files ( *.zip, *.txt, *.tar.gz, *.doc, …etc ). These files reside within a path. I want to find all the files ( *.txt), then copy, only, the text files that contain specific words ( e.g LINUX/UNIX).

Categories Q&A, Unix & Linux Tags cp, find, grep, text-processing Leave a comment

Edit file based on existence of a string

August 10, 2022 by Magenaut

I have an input file, say, file1, which appears as follows:

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

How to parse hundred html source code files in shell?

August 10, 2022 by Magenaut

I have a couple of hundred html source code files. I need to extract the contents of a particular <div> element from each of these file so I’m going to write a script to loop through each file. The element structure is like this:

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

Replace space with new line

August 10, 2022 by Magenaut

How can I replace spaces with new lines on an input like:

Categories Q&A, Unix & Linux Tags string, text-processing Leave a comment
Older posts
Newer posts
← Previous Page1 Page2 Page3 Page4 … Page15 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