This will check all files in the current directory. The sed is to add a newline after the word, to guarantee it never happens more than once per line, so that grep can count them properly. If you know the word will never happen more than once per line, the sed part can be dispensed with.
should work if the word is unique enough, never occuring in a piece of a larger word.
Hello my friends, I need to count how many words are into a log file, I'm using:
cat logfile | grep 'word' | wc -l
Cuz the 'word' appears once per line.
But my logfile grow faster and at the end ofthe day is really big, so how i can count the 'word' only from (by example) line 4000 of... (5 Replies)
Hi all
Can anybody suggest me, how to get the count of digits in a word
I tried
WORD=abcd1234
echo $WORD | grep -oE ] | wc -l
4
It works in bash command line, but not in scripts :mad: (12 Replies)
hello everyone,
I'm trying to learn some scripts but i cant get my head around two of them.
1. how can i write a script that will count the number of times a particular word is used in file?
2. how can i make a script that will take me to a web page from unix?
if anyone could help it... (3 Replies)
I want to count the number of occurences of say "200" in a file but that file also contains various stuff including dtaes like 2007 or smtg like 200.1 so count i am getting by doing grep -c "word" file is wrong
Please help!!!!! (8 Replies)
I am a newbie in UNIX shell script and seeking help on this UNIX function. Please give me a hand. Thanks.
I have a large file. Named as 'MyFile'. It was tab-delmited. I am told to write a shell function that counts the number of occurrences of the ord “mysring” in the file 'MyFile'. (1 Reply)
Hey all,
I'm looking for a command that will search a directory (and all subdirectories) and give me a file count for the number of files that contain specific characters within its filename. e.g. I want to find the number of files that contain "-a.jpg" in their name.
All the searching I've... (6 Replies)
Hi,
I need help regarding counting specific word or character per line and validate it against a specific number i.e 10. And if number of character equals the specific number then that line will be part of the output.
Specific number = 6
Specific word or char = ||
Sample data:... (1 Reply)
Hi All!
I would like to have a script that will count the number of files at the top of the hour of soome directories and mail the results to me.
I was thinking on :
a=`/directory/subdirectory/ | wc -l`
echo "/directory/subdirectory :$a"
b=`/another_dir/subdir/ | wc -l`
echo... (12 Replies)
Hi
Please can you help how do I count the number of specific characters or words that appear in a file? (8 Replies)
Discussion started by: fretagi
8 Replies
LEARN ABOUT DEBIAN
sql::reservedwords::postgresql
SQL::ReservedWords::PostgreSQL(3pm) User Contributed Perl Documentation SQL::ReservedWords::PostgreSQL(3pm)NAME
SQL::ReservedWords::PostgreSQL - Reserved SQL words by PostgreSQL
SYNOPSIS
if ( SQL::ReservedWords::PostgreSQL->is_reserved( $word ) ) {
print "$word is a reserved PostgreSQL word!";
}
DESCRIPTION
Determine if words are reserved by PostgreSQL.
METHODS
is_reserved( $word )
Returns a boolean indicating if $word is reserved by either PostgreSQL 7.3, 7.4, 8.0 or 8.1.
is_reserved_by_postgresql7( $word )
Returns a boolean indicating if $word is reserved by either PostgreSQL 7.3 or 7.4.
is_reserved_by_postgresql8( $word )
Returns a boolean indicating if $word is reserved by either PostgreSQL 8.0 or 8.1.
reserved_by( $word )
Returns a list with PostgreSQL versions that reserves $word.
words
Returns a list with all reserved words.
EXPORTS
Nothing by default. Following subroutines can be exported:
is_reserved
is_reserved_by_postgresql7
is_reserved_by_postgresql8
reserved_by
words
SEE ALSO
SQL::ReservedWords
<http://www.postgresql.org/docs/manuals/>
AUTHOR
Christian Hansen "chansen@cpan.org"
COPYRIGHT
This program is free software, you can redistribute it and/or modify it under the same terms as Perl itself.
perl v5.8.8 2008-03-28 SQL::ReservedWords::PostgreSQL(3pm)