Suppose that you have a big file with lines of this format: A, B, C, D (each line has 4 parts comma separated).
I need a list of all the lines which have common fourth part (D is the same across those ...
I search a pattern, say 'START OF ARAMBOL' and it is matched in a file. Now I would like to comment every line from the line no 1 to the current matched pattern line no. I have to do it for more than ...
I have in the input file a column with the following format
I want the output to have the following format
I have an issue in which my string its not a single string; it is a string with multiple words; in which using sed works great; but not with awk;
How can I group all that string with awk? I tried to ...
I want to use sed to replace every '} that comes at the end of the line to "}. I wrote:
sed -i -e "s/'}$/\"}$/g"
But this replaces it to: "}$. What is wrong? How can I use regex in my sed to express ...
I need to extract the characters before last colon : and also remove the square brackets  in the last line.
My file structure is
I have a string which is concatenation of "key":"value" pairs separated by "," like-
KEY1:VALUE1, KEY2:VALUE2, KEY3:VALUE3
From this string, I have to grep for a specific string -- let's say KEY2 -- ...
I want to modify the cygwin path to the windows path from within a makefile.
For that purpose, I am using
CURDIR := `pwd`
WINDIR := $(shell echo $(CURDIR) | sed -e "s/\/cygdrive\/\(.\)/\1:/" | sed -e ...
I have a text (csv) file like this:
I have a m3u file as below. I want to delete all strings except the pattern and next first line. or save the pattern and the next first line as another file.
Patterns group-title="TR ULUSAL" , group-...
I have a bash script which reads a file having multiple line of text and executes a command on those lines. Sometimes the command work, but sometimes it fails. I want to append a pound sign (#) at the ...
I have a fixed-length data file where records are tagged (first 6 characters have a certain string that identifies the record) and I need to replace text from a specific line and a specific position ...
I have a block content in my ~/.ssh/config. begin with a line '# BEGIN AUTO GENERATED CONTENT' and end with a line '# END AUTO GENERATED CONTENT'
I have a command replacing content between this two ...