I have the following:
cat /var/log/example.log | cut -d ' ' -f 3,4,5,6 | sort -u | uniq
The result has several thousand lines but I would like to cut this down to show the actual activity and to do ...
I'm trying to edit a text file containing several duplicates. The goal is to keep only the first match of a string and remove the rest duplicate lines of the same string.
In the example file
* Title 1
I have a CSV file that I need to include a separator to highlight the cents in that column that doesn't interfere with the ',' delimiter
Below is the model of how my current file is:
I want to programatically process the results of nmap output but cannot work out how to take the output and extract just the details of the protocol or port tables shown in the two outputs below.
I am ...
I have been trying to implement a Feature in my Shell Script but somehow stuck in implementation, need help please.
Sample File - f1.txt
Here is the data file as input.
How I can get the desired OUTPUT using sed? Regex for matching pattern is ...
I want to match multiple patterns in text files (in different directories) on the same line, copy the matched line to next line and modify the copied line.
I want to duplicate every line that contains ...
I would like to delete all entries with (L=6), (L=7).....(L=12) occurring in a file randomly the following format;
my input file:
TRINITY_DN1910_c0_g1_i13 GO:0005975(L=2) GO:0006022(L=4) GO:0006026(...
I asked some questions about how to handle a csv file and this result was numerous processes.
Every month I get several TXT files in a Google Drive directory. I need to process, unite and load this ...
I have the following csv
I have a dataset in csv format like this (6000 rows):
I have file like below:
I want output as below:
I am reading about range addresses in GNU sed. But I don't understand how does that exactly work, I have tried to run sed --debug but the output is too verbose to understand.
Let's assume that I have ...
I have a very large text file with multiple sections. These sections include section headers. I would like to extract the section headers and print them with grep or sed. The file looks like this:
I have a CSV file with two columns. The first is ID (int) and the second is text. All lines have the ID column. I want to remove files where the second column is empty (zero-length or space only).
I need to read every full word from each line of a file and replace every occurrence of that word (if found anywhere in the file) using sed or awk with the word from another file.
Contents of fileA....
I've come upon this sed command and I cannot figure out what it is doing. I understand that it is changing a file in place using -i, that it is using a script -e and that the script is $a\, but what ...
I am trying to remove the numbers at the start of the line with the following command:
sed -i 's/^\d*\t//' sea_news_2020_corpus.txt
The line looks as follows:
809940 The sea will be moderate in the ...
I have a HLS playlist file looking like this:
I know I can replace a substring with sed and integrate command evaluation with $(...).
But what if I want the replacement to be calculated from the string to be replaced?
I have a formatted ...
Tried a lot of awk and sed commands, but cant get the file to format properly. The primary issue is with handling of extra comma in the middle of a column that exits sometimes and doesnt exist other ...
in a file I have the following lines
I need to comment out the lines xxx, yyy, zzz. So I run the following command:
sed -e '/xxx/ s/^#*/#/' -i file
sed -e '/yyy/ s/^#*/#/' -i file
I have the following file format
Received from +11231231234 at 2021-10-10T19:56:50-07:00:
This is a message that contains words like from, at, etc.
Sent to +11231231234 at 2021-10-11T06:50:57+00:00:
I have a mix of filenames and relative paths in a markdown file that I want to refactor so that the full relative path to ~/app/ is inserted for interoperability between markdown readers.
For my files ...
I've got a file called test.txt and after some manipulations it looks like this:
Global and overview maps
01100 Metabolic pathways (1689)
01110 Biosynthesis of secondary metabolites (677)