Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Grep search for count of letters beginning with a certain letter Post 302893017 by spacebar on Sunday 16th of March 2014 10:42:19 PM
Old 03-16-2014
This is a simple example:
Code:
$ grep '^[a]' test | grep e -o | wc -l
1

Code:
$ grep '^[a]' test
a
aer

Code:
$ cat test
a
bat
cde
aer
zse

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

grep - to exclude lines beginning with pattern

11132 13069 11137 11142 13070 Can I use grep command to exclude all lines beginning with 13? I dont want to use grep -v 13 as potentially there will be a number with something like 11013 that I would exclude in error.. (2 Replies)
Discussion started by: frustrated1
2 Replies

2. UNIX for Dummies Questions & Answers

How to search for capital letters

Hi, I just want to search a file for any words containng a capital letter and then display a list of just these words! I have been trying grep but to no has not helped.(im using the bash shell) (1 Reply)
Discussion started by: djdaniel3
1 Replies

3. Homework & Coursework Questions

Grep for filetype starting with letter p

Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted! 1. The problem statement, all variables and given/known data: Which files in /usr/bin whose names begin with “p” are python scripts? Store the numbered results in... (3 Replies)
Discussion started by: alindner
3 Replies

4. UNIX for Dummies Questions & Answers

Count Number Of lines in text files and append values to beginning of file

Hello, I have 50 text files in a directory called "AllFiles" I want to make a program that will go inside of the "AllFiles" Directory and count the number of lines in each individual text file. Then, the program will calculate how many more lines there are over 400 in each text file and... (7 Replies)
Discussion started by: motoxeryz125
7 Replies

5. UNIX for Dummies Questions & Answers

Grep /Awk letters X - X in every line and print it as a mac address

hey i m kinda new to this so i will appreciate any help , i have this list of values: pwwn = 0x50012482009cd7a7 nwwn=0x50012482009cd7a6 port_id = 0x280200 pwwn = 0x5001248201bcd7a7 nwwn=0x5001248201bcd7a6 port_id = 0x280300 pwwn = 0x50012482009c51ad nwwn=0x50012482009c51ac port_id =... (4 Replies)
Discussion started by: boaz733
4 Replies

6. UNIX for Dummies Questions & Answers

Grep.Need help with finding the words which start at [A-K] letters in thesecond column of the table

Hi buddies ! I need some help with one grep command :) I have this table: 1 Petras Pavardenis 1980 5 08 Linas Bajoriunas 1970 10 3 Saulius Matikaitis 1982 2 5 Mindaugas Stulgis 1990... (1 Reply)
Discussion started by: vaidastf
1 Replies

7. Shell Programming and Scripting

AWK count letters words

Hi All! can anyone help me with this code? I want to count words or letters in every line with if(count>20){else echo $myline} awk '/<script /{p=1} /<\/script>/{p=0; next}!p' index.html | while read myline; do echo $myline done Thank you !!! (3 Replies)
Discussion started by: sanantonio7777
3 Replies

8. Shell Programming and Scripting

grep grab 19 letters from now or a full line

Hi, I have a file like this >hg19_chr1_123_456_+ asndbansbdahsjdbfsjhfghjdsghjdghjdjhdghjjdkhfsdkjfhdsjkdkjghkjdhgfjkhjfkf hasjgdhjsgfhjdsgfdsgfjhdgjhdjhdhjdfhjdfjgfdfbdghjbfjksdhfjsfdghjgdhjgfdjhgd jhgdfj >hg19_chr1_123_456_-... (5 Replies)
Discussion started by: jacobs.smith
5 Replies

9. Shell Programming and Scripting

Grep/Awk on 1st 2 Letters in 2nd Column of File

Hi everyone. I need to change a script (ksh) so that it will grep on the 1st 2 letters in the second column of a 5 column file such as this one: 192.168.1.1 CAXY0_123 10ABFL000001 # Comment 192.168.1.2 CAYZ0_123 10ABTX000002 # Comment 192.168.2.1 FLXY0_123 11ABCA000001 ... (4 Replies)
Discussion started by: TheNovice
4 Replies

10. UNIX for Beginners Questions & Answers

View a file and count all words beginning with specificletter

I am trying to write a command and need to count all the words within the file which begin with the letter S I have run this command $ grep '^' TheAgileApproach.dat | wc -l 0 $ grep '^' TheAgileApproach.dat | wc -l 1 When I remove the wc -l I see the output as below: $ grep '^'... (7 Replies)
Discussion started by: simpsa27
7 Replies
ALTER TEXT SEARCH 
DICTIONARY(7) PostgreSQL 9.2.7 Documentation ALTER TEXT SEARCH DICTIONARY(7) NAME
ALTER_TEXT_SEARCH_DICTIONARY - change the definition of a text search dictionary SYNOPSIS
ALTER TEXT SEARCH DICTIONARY name ( option [ = value ] [, ... ] ) ALTER TEXT SEARCH DICTIONARY name RENAME TO new_name ALTER TEXT SEARCH DICTIONARY name OWNER TO new_owner ALTER TEXT SEARCH DICTIONARY name SET SCHEMA new_schema DESCRIPTION
ALTER TEXT SEARCH DICTIONARY changes the definition of a text search dictionary. You can change the dictionary's template-specific options, or change the dictionary's name or owner. You must be the owner of the dictionary to use ALTER TEXT SEARCH DICTIONARY. PARAMETERS
name The name (optionally schema-qualified) of an existing text search dictionary. option The name of a template-specific option to be set for this dictionary. value The new value to use for a template-specific option. If the equal sign and value are omitted, then any previous setting for the option is removed from the dictionary, allowing the default to be used. new_name The new name of the text search dictionary. new_owner The new owner of the text search dictionary. new_schema The new schema for the text search dictionary. Template-specific options can appear in any order. EXAMPLES
The following example command changes the stopword list for a Snowball-based dictionary. Other parameters remain unchanged. ALTER TEXT SEARCH DICTIONARY my_dict ( StopWords = newrussian ); The following example command changes the language option to dutch, and removes the stopword option entirely. ALTER TEXT SEARCH DICTIONARY my_dict ( language = dutch, StopWords ); The following example command "updates" the dictionary's definition without actually changing anything. ALTER TEXT SEARCH DICTIONARY my_dict ( dummy ); (The reason this works is that the option removal code doesn't complain if there is no such option.) This trick is useful when changing configuration files for the dictionary: the ALTER will force existing database sessions to re-read the configuration files, which otherwise they would never do if they had read them earlier. COMPATIBILITY
There is no ALTER TEXT SEARCH DICTIONARY statement in the SQL standard. SEE ALSO
CREATE TEXT SEARCH DICTIONARY (CREATE_TEXT_SEARCH_DICTIONARY(7)), DROP TEXT SEARCH DICTIONARY (DROP_TEXT_SEARCH_DICTIONARY(7)) PostgreSQL 9.2.7 2014-02-17 ALTER TEXT SEARCH DICTIONARY(7)
All times are GMT -4. The time now is 04:55 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy