16,626 questions
- Bountied 0
- Unanswered
- Frequent
- Score
- Trending
- Week
- Month
- Unanswered (my tags)
3
votes
6
answers
196
views
Generate all versions of a string with each letter replaced by a wildcard (?) once in bash
I am using grep to look for strings (sequences) in a fastq-file and extract matching reads (lines).
Since grep only finds perfect patterns, I was wondering whether it is possible in bash to generate a ...
Advice
0
votes
2
replies
15
views
Indesign GREP to select 'any character' followed by a space, followed by a right single quote
I'm looking for a way to avoid line breaks before a class year. I'd like to be able to select 'any character' followed by a space followed by a right single quote ("Michael Green ’87" ...
1
vote
0
answers
180
views
Is it possible to set stdin of a process to a pipe and the rest to a TTY device?
I am trying to spawn a process so that I can do the following:
Send text to its standard input and specify EOF by closing the stdin pipe.
Connect the process' stdout and stderr to a TTY device so ...
Advice
0
votes
5
replies
138
views
Find and process @concept tags in .Rd files
In several packages, I've added @concept tags to Roxygen documentation for datasets. I'd like to process these to create a datasets.csv file for the package, that would include these as tags for each ...
1
vote
1
answer
110
views
Why are Grep highlight sequences not read with `pty`?
I was experimenting with creack/pty while learning about pseudo terminals.
I spawned grep and hooked it up with a pseudo terminal device as follows:
package main
import (
"fmt"
&...
1
vote
1
answer
126
views
How to specify only one instead of multiple of a character in a row in grep regex?
I am trying to use a single grep command to search for all instances of $ until a single =
I have the following command so far grep -E '\$.*=' which returns all lines with a $ and then a = but it also ...
-13
votes
3
answers
130
views
Print the lines where no double letter is found, except once before and after a hyphen [closed]
I have an exercise where I have to print the lines where no letter is found multiple times, except when there is one and only one before and after an hyphen.
Few examples of the lines I get are these:
...
0
votes
1
answer
78
views
Negated character not working with literal `]` [duplicate]
I have a file test.txtwhich contains
ERROR [x]
If I try
grep -Eo "ERROR \[[^p]\]" test.txt
it matches ERROR [x].
But if I do:
grep -Eo "ERROR \[[^\]]\]" test.txt
which is trying ...
0
votes
3
answers
123
views
How to parse the colorized output of a command, in bash?
$ kscreen-doctor --outputs | grep connected
Output: 65 eDP-1 enabled connected priority 1 Panel Modes: 70:1920x1080@60*! 71:1920x1080@60 72:1920x1080@48 73:1680x1050@60 74:1400x1050@60 75:1600x900@60 ...
2
votes
6
answers
219
views
How to make multi-line regexp work in grep?
Let's take the following example text:
some:
- [email protected]\\
- [email protected]
- [email protected]
- [email protected] test
- [email protected]
list:
- [email protected]
- [email protected]
- [email protected]
- [email protected] ...
-1
votes
1
answer
190
views
Suggestions for making a file from a bigger file with grep or?
Looking for a suggestion that would be much faster. I have a large (232GB) file mongo backup. I want to take out only the April 24th lines and make a new file containing only this date or any date of ...
-2
votes
1
answer
123
views
Extract Jira ticket number in GitHub Actions with sed [closed]
I have a requirement where I have to extract the Jira ticket number using sed regex. I am using a self-hosted Windows runner. I have used solutions from other similar posts on Stack Overflow but ...
-2
votes
3
answers
118
views
Ignore more than one row for a pattern in bash
While listing some logs, I get the following pattern:
id:Batch1
1:processed
id:Batch2
1:processing and some info
I get multiple rows like this and they are not sorted in any way. There is no pattern ...
4
votes
3
answers
148
views
Print matched pattern in a file along with matched lines
In a complex script I am using grep to get matched lines using a pattern file
For example:
Here is the file containing text
$ cat file.txt
abc$(SEQ)asdasd
wwww$(SEQ)asqqqqqq
efg hij$(SEQ)asdasdasd$(...
0
votes
2
answers
115
views
How can i pipe grep outputs to tcl stdin?
There are multiple answers on the same for python and perl but I am unable to find any example for tcl. Basically the intention is to read the output of grep into tcl procedure via pipe. I tried
grep -...