Is there any way to add lines to the pattern space of sed?
I know a bit about the N flag, but am not able to use it to do what I want which is:
read a file n lines at a time. If I find a match I quit else move to the next line. e.g.
Florida State University, Tallahassee, FL, USA, Dr.
Hey everyone,
I've to count lines from string of files names then to show sum output of lines.
for example:
read x = F1 F2 F3
F1 = 12 lines
F2 = 14 lines
F3 = 10 lines
= 36
what I did is:
Code:
read x
echo $x >|temp
for x in $(cat temp)
do
wc -l < $x
done >| temp2
hello all,
i have a text file and i want to remove the first 6 lines and last two lines of it
thanks for your help
Hi,
Suppose I have a file with many lines as follows. Now I want to find the following questions from the file through shell script or commands.
Code:
My name is XYZ. XYZ works for GHT and XYZ is part of PES. GHT is a good organization. XYZ knows swimming. XYZ is also very keen in reading.
My stock (4.0.3 updated) S2 loses the signal when it sits with either the USB cable connected to my laptop or the charger cable connected.
It works for some time, then within an hour there is 'no lines' signal and I can't make a call.
If I pull the cable and wait for a few minutes it will find the signal again (3 lines) and everything works fine again.
I would really like to get it working with
Hi all,
I have a file with the data
Code:
1 abc
2 123
3 ;
4 rao
5 bell
6 ;
7 call
8 abc
9 123
10 ;
11 rao
12 bell
13 ;
I want remove the lines from 8 to 13 which are the repetion of the lines 1 to 6.
When i use the below command, one of semicolon (;) in the first 6 lines is also getting deleted which shouldn't.
Code:
sort myf
I have growing log file for which I want to display only the last 15 lines. Here is what I know I can do:
tail -n 15 -F mylogfile.txt
As the log file is filled, tail appends the last lines to the display. I am looking for a solution that only displays the last 15 lines and get rid of the lines before the last 15 after it has been updated. Would you have an idea?
Thank you!
I am trying to delete lines in archived Apache httpd logs
Each line has the pattern:
<ip-address> - - <date-time> <document-request-URL> <http-response> <size-of-req'd-doc> <referring-document-URL>
This pattern is shown in the example of 6 lines from the log in the code box below. These 6 lines are in a row, and all start with same IP address.