if the search pattern is near the at the beginning of the file "tail -r" does needs more time.
so tail or "tail -r" is always may not be the best solution to just sed without pipe.
regards
ygemici
You are mistaken. Take a close look at the original code provided by the OP. It counts from the end of the file until the first match from the end.
Any approach that begins at the beginning of the file would have to read every line in the file for two reasons:
1) To be certain that the last match (first from the end of the file) has been found
2) The total number of lines in the file would be necessary to calculate a line number indexed from the end of the file (NR - x + 1).
Hi,
I want to grep the line which has 'data11'.then from that line, i need to trace back and find out the immediate line which has the same timestamp of that grepped line.
for eg:
log file:
-----------
Process - data
Process - datavalue - 2345
Process - data
Process - data
Process... (9 Replies)
Hello All,
I have a following task that I need to accomplish through a script or program and I am looking for some help as I have exhausted my ideas.
1. given: a text file with thousands of lines
2. find: pattern A in file and get line number ( grep -n works)
3. find: the first occurence of... (14 Replies)
Hello Everyone.
I am trying to display contains of a file from a specific line to a specific line(let say, from line number 3 to line number 5). For this I got the shell script as shown below:
if ; then
if ; then
tail +$1 $3 | head -n $2
else
... (5 Replies)
Hi Experts,
I am very new to scripting and have a prb since few days and it is urgent to solve so much appreciated if u help me.
i have 2 files
file1.txt
9647810043118
9647810043126
9647810043155
9647810043161
9647810043166
9647810043185
9647810043200
9647810043203
9647810043250... (22 Replies)
Hi All,
I am stuck for quite sometime now. Below is a line in my file -
GS|ED|001075|001081|20110626|1806|100803|X|004010ST|130|100803001
This line occurs only once and it is the second line.
I have to break this line into two lines from ST (bold) such that it looks like -... (5 Replies)
Hi All,
Can you please guide me to search a string in a particular column of file and return the line number of the line where it was found using awk. As an example :
abc.txt
7000,john,2,1,0,1,6
7001,elen,2,2,0,1,7
7002,sami,2,3,0,1,6
7003,mike,1,4,0,2,1
8001,nike,1,5,0,1,8... (3 Replies)
Hi,
I have an XML file with around 1 billion rows in it and i am trying to find the number of times a particular tag occurs in it. The solution i am using works but takes a lot of time (~1 hr) .Please help me with an efficient way to do this.
Lets say the input file is
<Root>
... (13 Replies)
Hi ,
I have been trying to write a perl script to do this job. But i am not able to achieve the desired result. Below is my code.
my $current_value=12345;
my @users=("bob","ben","tom","harry");
open DBLIST,"<","/var/tmp/DBinfo";
my @input = <DBLIST>;
foreach (@users)
{
my... (11 Replies)
I have one array SPLNO with approx 10k numbers.Now i want to search the subscriber number from MDN.TXT file (containing approx 1.5 lac record)from the array.if subscriber number found in array it will perform below operation.my issue is that it's taking more time because for one number it's search... (6 Replies)
How to grep for searching a string within a begin and end pattern of a file.
Sent from my Redmi 3S using Tapatalk (8 Replies)
Discussion started by: Baishali
8 Replies
LEARN ABOUT DEBIAN
gnupod_search
GNUPOD_SEARCH(1) User Commands GNUPOD_SEARCH(1)NAME
gnupod_search - search and remove files
SYNOPSIS
gnupod_search [OPTION]...
DESCRIPTION
Search and Remove files
--help display this help and exit
--version
output version information and exit
-m, --mount=DIRECTORY
iPod mountpoint. Default is $IPOD_MOUNTPOINT
-t, --title=STRING
search songs by Title
-a, --artist=STRING
search songs by Artist
-l, --album=STRING
search songs by Album
-i, --id=INT
search songs by ID
-g, --genre=STRING
search songs by Genre
-c, --playcount=COUNT
search songs by Playcount
-s, --rating=STARS
search songs by Rating (1 star = 20, 2 stars = 40 ...)
-R, --podcastrss=RSS
search songs by podcast-rss
-U, --podcastguid=GUID
search songs by podcast-guid
-b, --bitrate=BITRATE
search songs by Bitrate
-o, --match-once
Search does not need to match multiple times (like ($a || $b || $c))
--delete
Remove (!) matched songs from the iPod
--view=ialt
Modify output, default is 'ialt'
t = title a = artist r = rating p = path
l = album g = genre c = playcount i = id
--rename="KEY=VALUE"
Rename KEY into VALUE for matched songs.
Example: Rename the Artist 'Jon Doe' into 'John Doe'
gnupod_search --artist="Jon Doe" --rename="artist=John Doe"
AUTHOR
Written by Adrian Ulrich
REPORTING BUGS
Report bugs to <bug-gnupod@nongnu.org>
COPYRIGHT
Copyright (C) Adrian Ulrich
This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICU-
LAR PURPOSE.
SEE ALSO
The full documentation for gnupod is maintained as a Texinfo manual. If the info program and GNUpod are properly installed at your site,
the command
info gnupod
should give you access to the complete manual.
gnupod_search 1.00 June 2005 GNUPOD_SEARCH(1)