Skip to main content

All Questions

Tagged with
1 vote
7 answers
313 views

Find all lines between two patterns, EXCLUSIVE of the second pattern?

Consider that I have the file listed below. I need to select all lines from every instance of the regex pattern Word A to before the regex pattern Word D. Word A Word B Word C Word D Word E Word F ...
RonJohn's user avatar
  • 1,144
0 votes
1 answer
218 views

Sorting lines based on certain digit pattern

Assume I have a text file with the following lines: 192.168.1.1.55555 192.168.1.1.55555 192.168.1.1.5555 192.168.1.1.555 192.168.1.1.55 192.168.1.1.55 192.168.1.1.5 8.8.8.8.4433 8.8.8.8.443 8.8.8.8....
Zarkos.Fina's user avatar
4 votes
8 answers
1k views

Find files with matched whole lines from a file

I have a file with this content: $ cat compromised_header.txt some unique string 1 some other unique string 2 another unique string 3 I wanted to find all files that have all the lines of above file ...
annahri's user avatar
  • 2,075
0 votes
3 answers
228 views

Range of lines in file

I have a file with a few o lines: C 1.31729690416596 -0.05166770188922 0.05026556004853 C 2.15676687192808 -0.87605403673920 0.93010807487406 C 1.45516592682388 -0....
dcarriagada's user avatar
0 votes
6 answers
415 views

Split each line by a delim read from another file and store all split word compounds in the result file

I want to split each line from file names by each and every delimiter from file delim and store the unique word compounds into result file compounds. Lines from names that were not split should be ...
dizcza's user avatar
  • 157
0 votes
3 answers
1k views

Extract module name and instance name from verilog/System Verilog file

I have a verilog/System Verilog file from which I want to extract only module_name and instance_name. From following single line: module_name #(.ANY_PARAMETER(.ANY_PARAMETER),.ANY_PARAMETER_1(....
Vishal Patel's user avatar
1 vote
2 answers
112 views

Editing the output of fslint with shell tools awk | grep | sed

The task is to transform this text file, output of the utility fslint, into a bash script with rm command lines for the duplicate file(s) to delete and commented lines for file(s) to keep, according ...
macxpat's user avatar
  • 29
3 votes
3 answers
1k views

Filtering list of numbers containing sequential digits

I would like to filter many text files. Each file contain a very long list of numbers. Filtering the files must occur by the number of the consecutive digits within each number. Example list form ...
Zahi's user avatar
  • 297
4 votes
3 answers
923 views

Filtering out numbers that have sequential- consecutive or non-consecutive digits

I have a file filled with numbers, number per line. Each number consists of two or three digits. I would like to filter out this file by any number has two or more sequential digits. These sequential ...
Ahmed's user avatar
  • 153
0 votes
1 answer
185 views

grep + search recursive complex syntax under folder in files/scripts

We want to search the following line recursive under folder/s awk '{print}'|grep -i -e 'port is up' -e 'valid output' so we did that: grep -r "awk '{print}'|grep -i -e 'port is up' -e 'valid output'...
yael's user avatar
  • 13.4k
-2 votes
1 answer
89 views

how to very exact match on complex lines

we have the following file: more test.txt export KAFKA_HEAP_OPTS="-Xmx8g -Xms8g" export KAFKA_JVM_PERFORMANCE_OPTS="-XX:MetaspaceSize=96m -XX:+UseG1GC -XX:MaxGCPauseMillis=20 -XX:...
yael's user avatar
  • 13.4k
2 votes
1 answer
180 views

awk paragraph does not work

I have downloaded the KingBase Lite 2018 Update 3 file from here. I now want to extract data from a single event such as the "FIDE Candidates 2018": I want to get all the paragraphs containing this ...
maddingl's user avatar
  • 644
1 vote
1 answer
434 views

linux + how to match UUID in fstab file [duplicate]

I need to wrote the follwing task that will be part in my bash script we want to match all lines with UUID words in fstab file according to the following rules: UUID is in begging of file or ...
yael's user avatar
  • 13.4k
1 vote
2 answers
46 views

How to add an extra line that also have a pattern in file containing a pattern in previous line?

I have a file - something \title{\hypertarget{A64L}{A64L(3)}} something \title{\hypertarget{MALLOC}{MALLOC(3)}} something \title{\hypertarget{STRCMP}{STRCMP(3)}} The word in {} may be anything, ...
alhelal's user avatar
  • 1,321
4 votes
1 answer
1k views

filter xml documents matching certains ids

Suppose you have a file containing many xml documents, like <a> <b> ... </a> in between xml documents there may be plain text log messages <x> ... </x> ... How ...
Evgeniy Berezovsky's user avatar

15 30 50 per page