Skip to main content

Questions tagged [text-processing]

Manipulation or examining of text by programs, scripts, etc.

Filter by
Sorted by
Tagged with
1 vote
2 answers
131 views

I have a folder with many subfolders full of various Quarto(reg) files & in those files there are links that are located in varying positions in the file lines. UPDATE ON 3 November 2025 in ...
iembry's user avatar
  • 205
4 votes
4 answers
455 views

I would like to be able to find all files in multiple directories whose file names start with the same string, but preferably not if that string is only one word or contains fewer than perhaps 5 ...
EmmaV's user avatar
  • 4,433
4 votes
4 answers
479 views

How to remove comments and newline symbols without using two pipes. I have bookmarks.txt file with comments. https://cookies.com # recipes cookbook https://magicwands.com # shopping I can copy link ...
normal_max's user avatar
2 votes
1 answer
112 views

Today I connected to a long-running process in tmux over ssh for work, to find that the pane the process was running in seems to have started using the wrong character encoding for its output, leading ...
Patronics's user avatar
  • 125
2 votes
1 answer
93 views

System Info alinuxchap@libertus-desktop:/usr/share/X11/xkb $ uname -a Linux libertus-desktop 6.12.25+rpt-rpi-v8 #1 SMP PREEMPT Debian 1:6.12.25-1+rpt1 (2025-04-30) aarch64 GNU/Linux alinuxchap@...
Signor Pizza's user avatar
3 votes
5 answers
716 views

In a certain script that we run routinely we configure hostnames in environment variables. Since hostnames can change overtime, we try to dynamically pick the current set of hosts using linux's ...
y2k-shubham's user avatar
2 votes
5 answers
146 views

I am trying to format and connect git log messages for later processing. I am using git log --pretty=format:'%H %s' to get commit hash and the complete message at the moment. I need commit messages to ...
xerxes's user avatar
  • 359
1 vote
3 answers
128 views

I have a PDB file (coordinates of atoms in a protein) on a Linux machine: ATOM 1 N GLY A 1 0.535 51.766 5.682 1.00 0.00 ATOM 2 CA GLY A 1 -0.712 50....
Paolo Lorenzini's user avatar
5 votes
6 answers
926 views

Consider this input and output: foo bar baz bar baz How do you achieve with a single AWK? Please explain your approach too. These are a couple tries: $ awk '{ $1 = ""; print(substr($0, 2)) ...
mbigras's user avatar
  • 3,502
0 votes
2 answers
134 views

In my Linux Computer there are many files called file1, file2, file3 ... in /dev/mapper/. Now I want to have an overview from the files what cipher is used how often. I tried this for i in /dev/...
user447274's user avatar
1 vote
3 answers
105 views

Can anyone help? I've exhausted my knowledge and troubleshooting skills trying to get this working. Here is the example data from "msg": date=2025-03-26 time=12:45:57 devname="this-is-...
user2008555's user avatar
0 votes
1 answer
171 views

I'm trying to replace bobearl with jim in the following string "billy" "bobearl" and "johnny" I can do something like this: sed 's/bob/jim/' /tmp/text.txt "billy&...
goswell's user avatar
0 votes
0 answers
109 views

Looking for advanced CLI tool/code to determine text Codepage/Language (besides enca). Goal: Automate as much as possible conversion of hundreds/thousands of 8-bit text files (including non-ASCII ...
strider's user avatar
  • 113
9 votes
5 answers
2k views

I have a CSV file and want to run a command for each line, using the fields of the file as separate arguments. For example given the following file: foo,42,red bar,13,blue baz,27,green I want to run ...
luator's user avatar
  • 312
-4 votes
5 answers
197 views

From the script below I need to know the following: EmpNo#Email#Name#JobLevel#Experience 641357#Amrit_Mohanty#Amrit Mohanty#3#2 678522#Puneet_Mishra#Puneet Mishra#3#1 670242#Vikas_Bharti#Vikas Bharti#...
Ismael Sanchez's user avatar
3 votes
5 answers
706 views

A typical latex problem: \SomeStyle{\otherstyle{this is the \textit{nested part} some more text...}} Now I want to remove all \SomeStyle{...} but not the content. Content contains nested braces. The ...
Thierry Blanc's user avatar
2 votes
2 answers
1k views

On Kubuntu Linux, The Google Chrome browser adds a checksum to the file, preventing simply editing the file by hand. So I'm writing a script to add the checksum. $ cat .config/google-chrome/Default/...
dotancohen's user avatar
  • 16.5k
-2 votes
3 answers
189 views

In a directory I have a bunch of text files. Some of the files contain double lines with a [tab] char only. I want to find and change these two "tabbed lines" into one line with a new line ...
ludvick's user avatar
  • 21
6 votes
2 answers
390 views

I have a huge JSON object with an array of objects inside it. I have to add key:value pair to a specific object in the array. For example, let the input object is: { "a": { "b&...
Vlado B.'s user avatar
0 votes
1 answer
240 views

I want to apply commands below to all files in a directory instead of one file. cat file.txt | sed -E "s/\@([0-9]+)\W+~(.*?)/\1 \2/g" | tr -d '~' cat file.txt | sed -E "s/\@([0-9]+).*\~...
user1002601's user avatar
0 votes
2 answers
121 views

My situation is simple : I have an HTML file with several lines containing only the indented <section> block tag, each line followed by an (also indented) <h3 id="YYYY">...</...
sylvansab's user avatar
  • 109
1 vote
1 answer
97 views

I have 2 files file1 00:00:00:00:00:01 file2 00:00:00:00:00:02 foo bar 00:00:00:00:00:01 something else What I want to do is compare the two files and remove 00:00:00:00:00:01 from file 2 so I end ...
Lurch's user avatar
  • 125
1 vote
8 answers
229 views

My input file: 1oo+457864227yexaloo+6784536pkp8907654 2oo+499004227yexaloo+69008908pkp8907654 3oo+648968976yexaloo+53589094pkp8907654 4oo+490764578yexaloo+6784536pkp8907654 I want to find out the ...
sre's user avatar
  • 11
3 votes
3 answers
486 views

I have a large file with the following format tab-separated: #CHROM POS ID REF ALT QUAL FILTER INFO FORMAT recombination chr1 586001 >63041388>63041391 G ...
Matteo's user avatar
  • 283
0 votes
2 answers
139 views

Let's say I have a program blackbox, and a file with the following contents: in this file this line contains =TAG= so does =TAG= this one as =TAG= does this other line this line does ...
wobtax's user avatar
  • 1,191

1
2 3 4 5
171