Sponsored Content
Top Forums Shell Programming and Scripting How to identify the occurence of a pattern between a unique character? Post 302378913 by divak on Wednesday 9th of December 2009 05:11:27 AM
Old 12-09-2009
Quote:
Originally Posted by zaxxon
Code:
awk '/{/,/}/ {if (tolower($0) ~ /good/) {z++}} END{print z}' z=0 infile

Hi,

Im getting this error, when running the command given.
Error msg for rour reference.

awk: There is a regular expression error.
?, *, or + not preceded by valid regular expression


Thanks
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

First occurence of character in a file

Hi All I have the following contents in a file say in a file name called 'FILE1' *********** Start of the file ************** SANDIO000456GROJ8900 SANDIO2338923GRJH900 *********** End of the file ******************* I want to cut the first line which has the characters.... (6 Replies)
Discussion started by: dhanamurthy
6 Replies

2. UNIX for Dummies Questions & Answers

Counting occurence of a particular character on each line

Hi, I have the following data in a flat file: abcd_efgh_ijkl_20080522.dat|20080602222508|1357 abcd_efgh_ijkl_20080522.dat|20080602222508|1357 abcd_efgh_ijkl_20080522.dat|20080602222508|1357 I need to check the no. of occurence of "|" (pipe) on each line and the output should look like below:... (4 Replies)
Discussion started by: hey_mak
4 Replies

3. UNIX for Advanced & Expert Users

How to count the occurence of a character in a line

Suppose i have data like :- 1,2,3,4,5 a,b,c x,y,z,t I want to count the occurence of , (comma) in every line. Waiting for a solution.:) (1 Reply)
Discussion started by: sumit207
1 Replies

4. UNIX for Dummies Questions & Answers

How to count the occurence of a character in a line

Suppose i have data like :- 1,2,3,4,5 a,b,c x,y,z,t I want to count the occurence of , (comma) in every line. Waiting for a solution. (5 Replies)
Discussion started by: sumit207
5 Replies

5. UNIX for Dummies Questions & Answers

How to search unique occurence in a file?

Hi, I have to search and count unique occurence of DE numbers in bold below in a file which has content like below. Proc Tran F-BUY Item Tkey Q5JV Item Tsid JTIZ9 Item Tdat 20091001 Item Tset 20091001 Item Tbkr 5 Item Tshs 2 Item Tprc 897.0 Item Tcom 2000.0 Item Tcm1 20091001... (6 Replies)
Discussion started by: akash028
6 Replies

6. Shell Programming and Scripting

Identify file pattern, take count of pattern, then act

Guys - Need your ideas on a section of code to finish something up. To make a long story short, I'm parsing a print output file that goes to pre-printed forms. I'm intercepting it, parsing it, formatting it, cutting it up into individual pages, grabbing the text I want in zones, building an... (3 Replies)
Discussion started by: ampsys
3 Replies

7. Shell Programming and Scripting

Regex to identify unique words in a dictionary database

Hello, I have a dictionary which I am building for the Open Source Community. The data structure is as under HEADWORD=PARTOFSPEECH=ENGLISH MEANING as shown in the example below अ=m=Prefix signifying negation. अँहँ=ind=Interjection expressing disapprobation. अं=int=An interjection... (2 Replies)
Discussion started by: gimley
2 Replies

8. Shell Programming and Scripting

How to identify varying unique fields values from a text file in UNIX?

Hi, I have a huge unsorted text file. We wanted to identify the unique field values in a line and consider those fields as a primary key for a table in upstream system. Basically, the process or script should fetch the values from each line that are unique compared to the rest of the lines in... (13 Replies)
Discussion started by: manikandan23
13 Replies

9. UNIX for Beginners Questions & Answers

Awk: count unique elements in a field and sum their occurence across the entire file

Hi, Sure it's an easy one, but it drives me insane. input ("|" separated): 1|A,B,C,A 2|A,D,D 3|A,B,B I would like to count the occurence of each capital letters in $2 across the entire file, knowing that duplicates in each record count as 1. I am trying to get this output... (5 Replies)
Discussion started by: beca123456
5 Replies

10. Shell Programming and Scripting

Extract whole word preceding a specific character pattern with first occurence of the pattern

Hello. Here is a file contents : declare -Ax NEW_FORCE_IGNORE_ARRAY=(="§" ="§" ="§" ="§" ="§" .................. ="§"Here is a pattern =I want to extract 'NEW_FORCE_IGNORE_ARRAY' which is the whole word before the first occurrence of pattern '=' Is there a better solution than mine :... (3 Replies)
Discussion started by: jcdole
3 Replies
Mail::SpamAssassin::Plugin::ReplaceTags(3)		User Contributed Perl Documentation		Mail::SpamAssassin::Plugin::ReplaceTags(3)

NAME
Mail::SpamAssassin::Plugin::ReplaceTags - tags for SpamAssassin rules The plugin allows rules to contain regular expression tags to be used in regular expression rules. The tags make it much easier to maintain complicated rules. Warning: This plugin relies on data structures specific to this version of SpamAssasin; it is not guaranteed to work with other versions of SpamAssassin. SYNOPSIS
loadplugin Mail::SpamAssassin::Plugin::ReplaceTags replace_start < replace_end > replace_tag A [a@] replace_tag G [gk] replace_tag I [il|!1y?xccxcdxcexcfxecxedxeexef] replace_tag R [r3] replace_tag V (?:[vu]|\/) replace_tag SP [s~_-] body VIAGRA_OBFU /(?!viagra)<V>+<SP>*<I>+<SP>*<A>+<SP>*<G>+<SP>*<R>+<SP>*<A>+/i describe VIAGRA_OBFU Attempt to obfuscate "viagra" replace_rules VIAGRA_OBFU RULE DEFINITIONS AND PRIVILEGED SETTINGS
replace_tag tagname expression Assign a valid regular expression to tagname. Note: It is not recommended to put quantifiers inside the tag, it's better to put them inside the rule itself for greater flexibility. replace_pre tagname expression Assign a valid regular expression to tagname. The expression will be placed before each tag that is replaced. replace_inter tagname expression Assign a valid regular expression to tagname. The expression will be placed between each two immediately adjacent tags that are replaced. replace_post tagname expression Assign a valid regular expression to tagname. The expression will be placed after each tag that is replaced. replace_rules list_of_tests Specify a list of symbolic test names (separated by whitespace) of tests which should be modified using replacement tags. Only simple regular expression body, header, uri, full, rawbody tests are supported. replace_start string replace_end string String(s) which indicate the start and end of a tag inside a rule. Only tags enclosed by the start and end strings are found and replaced. perl v5.12.1 2010-03-16 Mail::SpamAssassin::Plugin::ReplaceTags(3)
All times are GMT -4. The time now is 05:34 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy