01-27-2005
Last word of lines
Hello,
I have a file in which there are many lines.
I don't know the length of any line and they also vary.
I want to pick the last word of those lines which end with for eg. xyz
Thanks in Advance
9 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
Hi all,
Can someone suggest how to append some word to all lines in file. for example word "Honey" to file f1 with lines:
Mia
Katrin
Elizabeth
to get
Honey Mia
Honey Katrin
Honey Elizabeth
Thanks in advance
Givi (3 Replies)
Discussion started by: giviut
3 Replies
2. Shell Programming and Scripting
Hi all, I am trying to write a command that can help me count the number of lines in the /etc/passwd file ending in bash.
I have read through other threads but am yet to find one indicating how to locate a specifc word at the end of a line. I know i will need to use the wc command but when i... (8 Replies)
Discussion started by: warlock129
8 Replies
3. Shell Programming and Scripting
Hi,
I have a query on using grep options. I tried with several options but unable to do it.
lanite:52> cat note
123 456 ab 123
ab cv 234 4566 67
ab gh tij ab 12 34 ab
ab cv dfgv ab cv ab kjhk ab ghj
sdf
dfg ab jljklj ab
Now, I need to use grep to find the line which contains the... (6 Replies)
Discussion started by: dilipr25
6 Replies
4. Shell Programming and Scripting
i jst want to delete a host entry from httpd.conf
for eg:
i have entries such as:
<VirtualHost 192.168.1.157:80>
DocumentRoot /home/karthik
ServerName kar
</VirtualHost>
<VirtualHost 192.168.1.157:80>
DocumentRoot /home/karthik1
ServerName www
</VirtualHost>
<VirtualHost... (4 Replies)
Discussion started by: jacky29
4 Replies
5. Shell Programming and Scripting
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
P1
10,23423432
,77:1
,234:2
P2
10,9089004
,77:1
,234:2
,87:123
,9898:2
P3
456456
P1
:123,456456546
P2
abc:324234 (2 Replies)
Discussion started by: vsachan
2 Replies
6. UNIX for Dummies Questions & Answers
Hi
I have this txt file getting from a lpstat command.
XA40 XA40 0 Unknown 0 0 1 1 1
0 Unknown LPD 0 0 1 1 2
0 Unknown specified 0 0 1 1 3
XA99 @spip READY
: (FATAL ERROR) 0781-233 Unknown host spiprs01.mon.local.
XA01 @xs00 READY
XA01 XA01 0 Unknown 0 0 1 1 1
0 Unknown LPD 0 0 1 1... (5 Replies)
Discussion started by: npatao71
5 Replies
7. UNIX for Dummies Questions & Answers
Hi, i have a file like this:
A1
kdfjdljfdkljfdlf
A2
lfjdlfkjddkjf
A3
***no hit***
A4
ldjfldjfdk
A5
***no hit***
A6
jldfjdlfjdlkfjd
I want to remove the lines "***no hit*** and their above line to get an output file like this: (11 Replies)
Discussion started by: the_simpsons
11 Replies
8. Shell Programming and Scripting
Hi All,
I have a XML file which is looks like as below. <<please see the attachment >>
<?xml version="1.0" encoding="UTF-8"?>
<esites>
<esite>
<name>XXX.com</name>
<storeId>10001</storeId>
<module>
... (4 Replies)
Discussion started by: Rajeev_hbk
4 Replies
9. Shell Programming and Scripting
I have a file where every line includes four expressions with a caret in the middle (plus some other "words" or fields, always separated by spaces). I would like to extract from this file, all those lines such that each of the four expressions containing a caret appears in at least four different... (9 Replies)
Discussion started by: uncleMonty
9 Replies
LEARN ABOUT DEBIAN
cdbsplit
COOKIETOOL(6) Games Manual COOKIETOOL(6)
NAME
cdbsplit - program to operate cookie (fortune) database
SYNOPSIS
cdbsplit [options] <cookie-database> <hitfile>
DESCRIPTION
This manual page documents briefly the cdbsplit command.
This manual page was written for the Debian GNU/Linux distribution because the original program does not have a manual page. Instead, it
has some plain text documentation, see below.
cdbsplit is a program that can be used to operate cookie database in various formats, the default is standard fortune(6) format, i.e. list
of 'cookies' delimited with line containing a single percent ('%') char . With 'cdbsplit' you can split cookie database, or extract parts
of it depending on various criteria.
OPTIONS
A summary of options is included below. For a complete description, see the documentation in /usr/share/doc/cookietool directory. NOTE,
that default behaviour is to overwrite existing database with its reduced version, so the cookies are MOVED to hitfile. The hitfile is
never overwritten, but may be appended to.
[nothing]
Shows summary of options.
-c case-sensitive comparisons (for both keywords and groups)
-d[0-3]
how fussy about word delimiters? (default: 2)
-k<keyword>
optional keyword
-K<keyword>
mandatory keyword (use both of them to form boolean expressions)
-l<min_lines>
minimal cookie length (in lines)
-L<max_lines>
maximal cookie length (in lines)
-w<chars>
minimal line width (in chars)
-W<chars>
maximal line width (in chars)
-n<min_number>
start at cookie <min_number>
-N<max_number>
stop after <max_number> cookie
-m<chars>
find groups of cookies starting with <n> matching characters (database must be sorted for this to make sense!)
-x extract only, don't modify <cookie-database>
-a append, don't overwrite <hitfile> if such a filename exists
-f[0-3]
input file format - -f3: cookies are separated by '%%' lines; -f2: cookies are separated by '%' lines (DEFAULT); -f1: each line is a
cookie; -f0: each word is a cookie.
SEE ALSO
cookietool(6), cdbdiff(6)
BUGS
None known.
AUTHOR
Upstream author and Aminet cookietool.lha package with AmigaOS binaries uploader is Wilhelm Noeker, <wnoeker@t-online.de>. Unix manpages
(including this one) and makefile are maintained by Miros/law L. Baran <baran@debian.org>. This manual page uses many excerpts from the
original README file.
May 19, 2001 COOKIETOOL(6)