Search the word to be deleted and delete lines above this word starting from P1 to P3
Hi,
I have to search a word in a text file and then I have to delete lines above from the word searched . For eg suppose the file is like this:
Records
and so on.
The file contains thousands of records.
Now I have to search for a particular word for eg I am searching 9089004. Then the records in which 9089004 will lie I mean from P1 till P3 will be deleted from the file and rest of the records will exist in the file. The problem is that the word can exist anywhere between P1 to P2 or from P2 to P3 and then I have to delete that record i.e. from P1 to P3.
example
- shsk
mss-sdsd-asd
i need a command which will search for staring word not others
it should search only -shsk
cat filename | grep '-'
will search whole '-' in the file but i need to search only staring '-'
thank u
revenna (1 Reply)
Hi,
Please suggest how to write a shell script which delets all the lines containing the word unix in the files supplied as argument in the shell. (4 Replies)
Hi all coders,
I need a help to process some data.
I have this file,
3 09/21/08 03:32:07 started undef mino Oracle nmx004.wwdc.numonyx.co
m
Message Text : The Oracle session with the PID 1103 has a CPU time
consuming of 999.00... (3 Replies)
Let's say we have a file containing:
alllllsadfsdasdf
qwdDDDaassss
ccxxcxc#2222
dssSSSSddDDDD
D1Sqn2NYOHgTI
Hello
Alex
ssS@3
Ok, and let's say we want to delete all words from D1Sqn2NYOHgTI and back, this means
to delete the words (and the lines of them) :
alllllsadfsdasdf... (2 Replies)
Hi, i am new to unix shell scripting and i need a script which would search for a particular word in all the files present in a directory. The output should have the word and file path name. For example: "word" "path name".
Thanks for the reply in adv,:) (3 Replies)
Hi All,
I have a file in which a number of lines are starting with similar first word but different next words.
I want to replace the any nth word(not 1st or 2nd) with another word.
Eg:- My file contains are like this:-
Ram is a boy.
Ram is a good boy.
Ram plays cricket.
Here I want to... (2 Replies)
I have a file input.txt which have loads of weird characters, html tags and useful materials. I want to display 35 characters after the word description excluding weird characters like $$#$#@$#@***$# and without html tags in the new file output.txt. Help me. Thanx in advance.
My final goal is to... (11 Replies)
I have a file input.txt which have loads of weird characters, html tags and useful materials. I want to display 35 characters after the word "description" excluding weird characters like $&lmp and without html tags in the new file output.txt. Help me. Thanx in advance. I have attached the input... (4 Replies)
Hi,
I have a sample file as shown below, I am looking for sed or any command which prints the complete word only from the input file.
Ex:
$ cat "sample.log"
I am searching for a word which is present in this file
We can do a pattern search using grep but I need to cut only the word which... (1 Reply)
I have a multicolumn text file with header in the first row like this
The headers are stored in an array called . which contains I want to search for each elements of this array from that multicolumn text file. And I am using this awk approach
for ii in ${hdr}
do
gawk -vcol="$ii" -F... (1 Reply)
Discussion started by: Atta
1 Replies
LEARN ABOUT POSIX
sortbib
sortbib(1) User Commands sortbib(1)NAME
sortbib - sort a bibliographic database
SYNOPSIS
sortbib [-s KEYS] database...
DESCRIPTION
sortbib sorts files of records containing refer key-letters by user-specified keys. Records may be separated by blank lines, or by `.[' and
`.]' delimiters, but the two styles may not be mixed together. This program reads through each database and pulls out key fields, which are
sorted separately. The sorted key fields contain the file pointer, byte offset, and length of corresponding records. These records are
delivered using disk seeks and reads, so sortbib may not be used in a pipeline to read standard input.
The most common key-letters and their meanings are given below.
%A Author's name
%B Book containing article referenced
%C City (place of publication)
%D Date of publication
%E Editor of book containing article referenced
%F Footnote number or label (supplied by refer)
%G Government order number
%H Header commentary, printed before reference
%I Issuer (publisher)
%J Journal containing article
%K Keywords to use in locating reference
%L Label field used by -k option of refer
%M Bell Labs Memorandum (undefined)
%N Number within volume
%O Other commentary, printed at end of reference
%P Page number(s)
%Q Corporate or Foreign Author (unreversed)
%R Report, paper, or thesis (unpublished)
%S Series title
%T Title of article or book
%V Volume number
%X Abstract -- used by roffbib, not by refer
%Y,Z Ignored by refer
By default, sortbib alphabetizes by the first %A and the %D fields, which contain the senior author and date.
sortbib sorts on the last word on the %A line, which is assumed to be the author's last name. A word in the final position, such as `jr.'
or `ed.', will be ignored if the name beforehand ends with a comma. Authors with two-word last names or unusual constructions can be sorted
correctly by using the nroff convention ` ' in place of a blank. A %Q field is considered to be the same as %A, except sorting begins with
the first, not the last, word. sortbib sorts on the last word of the %D line, usually the year. It also ignores leading articles (like `A'
or `The') when sorting by titles in the %T or %J fields; it will ignore articles of any modern European language. If a sort-significant
field is absent from a record, sortbib places that record before other records containing that field.
No more than 16 databases may be sorted together at one time. Records longer than 4096 characters will be truncated.
OPTIONS -sKEYS Specify new KEYS. For instance, -sATD will sort by author, title, and date, while -sA+D will sort by all authors, and date. Sort
keys past the fourth are not meaningful.
ATTRIBUTES
See attributes(5) for descriptions of the following attributes:
+-----------------------------+-----------------------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
+-----------------------------+-----------------------------+
|Availability |SUNWdoc |
+-----------------------------+-----------------------------+
SEE ALSO addbib(1), indxbib(1), lookbib(1), refer(1), roffbib(1), attributes(5)BUGS
Records with missing author fields should probably be sorted by title.
SunOS 5.10 14 Sep 1992 sortbib(1)