Skip to content

Magenaut

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

text-processing

How do I insert a space every four characters in a long line?

August 9, 2022 by Magenaut

I’ve got a long line that I want to insert a space every 4 characters, on a single lone line of solid text to make it easier to read, what’s the simplest way to do this? also I should be able to input the line from a pipe. e.g.

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

Replace pattern each time with a different string (taken from external file)

August 9, 2022 by Magenaut

I have an input:

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

How do I add newlines between lines printed on the command line?

August 9, 2022 by Magenaut

Mail logs are incredibly difficult to read. How could I output a blank line between each line printed on the command line? For example, say I’m grep-ing the log. That way, multiple wrapped lines aren’t being confused.

Categories Q&A, Unix & Linux Tags command-line, logs, output, text-formatting, text-processing Leave a comment

How do I break up a file like split to stdout for piping to a command?

August 9, 2022 by Magenaut

I have a large .sql file full of SELECT statements that contain data I want to insert into my SQL Server database. I’m looking for how I could basically take the file’s contents, 100 lines at a time, and pass it to the commands I have set to do the rest.

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

Print file content without the first and last lines

August 9, 2022 by Magenaut

Is there a simple way I can echo a file, skipping the first and last lines? I was looking at piping from head into tail, but for those it seems like I would have to know the total lines from the outset. I was also looking at split, but I don’t see a way to do it with that either.

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

command to layout tab separated list nicely

August 9, 2022 by Magenaut

Sometimes, I’m getting as an input tab separated list, which is not quite aligned, for instance

Categories Q&A, Unix & Linux Tags command-line, csv, tabulation, text-processing Leave a comment

Efficient in-place header removing for large files using sed?

August 9, 2022 by Magenaut

The commands below may takes minutes depends on the file size. Is there any more effient method?

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

How to grep lines between start and end pattern?

August 9, 2022 by Magenaut

I have a file which is having following content: zdk aaa b12 cdn dke kdn Input1: aaa and cdn Output 1: aaa b12 cdn Input 2: zdk and dke Output 2: zdk aaa b12 cdn dke I could use below commands to achieve: grep -a aaa -A2 file # Output 1 grep -a aaa -A4 … Read more

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

How to report “sed” in-place changes

August 9, 2022 by Magenaut

When using sed to replace strings in-place, is there a way to make it report the changes it does (without relying on a diff of old and new files)?

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

How to numerical sort by last column?

August 9, 2022 by Magenaut

I have this input:

Categories Q&A, Unix & Linux Tags sort, text-processing Leave a comment
Older posts
Newer posts
← Previous Page1 … Page6 Page7 Page8 … 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