awk repeats counter


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers awk repeats counter
# 8  
Old 11-30-2011
Quote:
Originally Posted by verse123
I am not sure if the script is taking into account the random numbers after the word DOG (like DOG[0-9]).
It will match regardless of where "DOG" is in the column. 1234DOG DOG1234 and 12DOG34 will all match. There is no requirement that the additional characters be numeric so abcDOGdef will match too.
 
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How to lowercase the values in a column in awk and include a dynamic counter?

Hi, I am trying to incorporate 2 functions into my `awk` command. I want to lower case Column 2 (which is essentially the same information in Col1, except in Col1 I want to maintain the capitalization) and I want to count from 0-N that begins and ends with the start of certain markers that I... (6 Replies)
Discussion started by: owwow14
6 Replies

2. Shell Programming and Scripting

awk - Skip x Number of Lines in Counter

Hello, I am new to AWK and in UNIX in general. I am hoping you can help me out here. Here is my data: root@ubuntu:~# cat circuits.list WORD1 AA BB CC DD Active ISP1 ISP NAME1 XX-XXXXXX1 WORD1 AA BB CC (9 Replies)
Discussion started by: tattoostreet
9 Replies

3. Shell Programming and Scripting

awk line instance counter

I Have a text file with several thousand lines of text. Occasionally there will be a "sysAlive" line of text (every so often) What would be an awk command to print every line of text, and to put in incrementing counter ONLY on the "sysAlive" lines For example: >cat file.txt lineAAA a b c d... (4 Replies)
Discussion started by: ajp7701
4 Replies

4. Shell Programming and Scripting

Remove brackets repeats and separate in columns

Hi all, I want to remove the remove bracket sign ( ) and put in the separate column I also want to remove the repeated entry like in first row in below input (PA156) is repeated ESR1 (PA156) leflunomide (PA450192) (PA156) leflunomide (PA450192) CHST3 (PA26503) docetaxel... (4 Replies)
Discussion started by: manigrover
4 Replies

5. UNIX for Dummies Questions & Answers

Can't figure out why this repeats

#!/bin/sh while IFS=: read address port; do : ${port:=443} address=$address port=$port cd $f_location number=`grep "$address" thing.txt -A 1 | grep "addresses=" | cut -d'"' -f2` echo "$address,$port,$number,$answer" >>... (9 Replies)
Discussion started by: shade917
9 Replies

6. Shell Programming and Scripting

sed behaving oddly, repeats lines

Hi, all. Here's the problem: sed '/FOO/,/BAR/p' That should print anything between FOO and BAR, right? Well, let's say I have file.txt that contains just one line "how are you today?". Then I run something like the above and get: $ sed '/how/,/today/p' file.txt how are you... (9 Replies)
Discussion started by: pereyrax
9 Replies

7. Shell Programming and Scripting

AWK counter problem

Hi I have a file like below ############################################ # ParentFolder Flag SubFolders Colateral 1 Source1/Checksum CVA 1 Source1/Checksum Flexing 1 VaR/Checksum Flexing 1 SVaR/Checksum FX 1 ... (5 Replies)
Discussion started by: manas_ranjan
5 Replies

8. Shell Programming and Scripting

word frequency counter - awk solution?

Dear all, i need your help on this. There is a text file, i need to count word frequency for each word with frequency >40 in each line of file and output it into another file with columns like this: word1,word2,word3, ...wordn 0,0,1 1,2,0 3,2,0 etc -- each raw represents... (13 Replies)
Discussion started by: irrevocabile
13 Replies

9. UNIX for Dummies Questions & Answers

Search for repeats in text file - how?

I have a text file that I want to search for repeated lines and print those lines. These would be lines in the file that appear more than once. Is there a way to do this? Thanks (4 Replies)
Discussion started by: aarondesk
4 Replies
Login or Register to Ask a Question
randomword(3)						     Library Functions Manual						     randomword(3)

NAME
randomword, randomchars, randomletters - Generate random passwords (Enhanced Security) LIBRARY
Security Library - libsecurity.so SYNOPSIS
int randomchars( char *string, unsigned short int minlen, unsigned short int maxlen, boolean restrict, long seed); int randomletters( char *string, unsigned short int minlen, unsigned short int maxlen, boolean restrict, long seed); int randomword( char *word, char *hyphenated_word, unsigned short int minlen, unsigned short int maxlen, boolean restrict, long seed); PARAMETERS
Points at a user-supplied space to contain a null-terminated password. Specifies the minimum length that a generated word can have. Spec- ifies the maximum length that a generated word can have. Specifies whether restrictions are to be imposed on the generated word. This is a boolean integer, where a non-zero integer indications restrictions and a 0 (zero) indicates no restrictions. Specifies an initial seed for the random number generator. Points at a user-supplied space to contain a null-terminated random pronounceable password. Contains the hyphenated version of the generated word. DESCRIPTION
These functions generate random passwords for use in password selection. All of them are generated by the system, based on seeds and set in the function. Such seeds can be created with the drand48(), rand(), or random() functions. The randomchars() function places a null-terminated password composed of random printable ASCII characters into the string parameter and returns the length of the generated string. The minlen parameter can equal maxlen, but cannot be greater than maxlen, and cannot be nega- tive. The user space preallocated is at least maxlen for string. The smaller minlen and maxlen are, the smaller the selection space of random words. The restrict parameter is 0 (zero) when no restrictions are placed on the generated word. It is nonzero when the words generated pass the tests of the acceptable_password() function. The seed parameter is used by the function only on the first time it is called; the parameter is ignored on subsequent calls. The randomletters() function places a null-terminated password composed of random lower-case letters into the string parameter and returns the length of the generated word. The minlen, maxlen, restrict, and seed parameters are the same as for the randomchars() function. The randomword() function places a null-terminated random pronounceable password into the word parameter and returns the length of the gen- erated word. The minlen, maxlen, restrict, and seed parameters are the same as for the randomchars() and randomletters() functions. The user space preallocated is at least 2*max - 1 for hyphenated_word. NOTES
The password generator relies on a random number generator that produces uniformly distributed integers. Because the password generator invokes the random number generator many times even for one word, the random number generator has to produce a uniform distribution. The period (distinct numbers produced given a particular seed) and number space (range of possible numbers) must both be large. The drand48() functions are used for this purpose. Programs using these functions must be compiled with -lsecurity. FILES
System password file. System group file. RELATED INFORMATION
Functions: acceptable_password(3), drand48(3), rand(3), random(3). Commands: login(1), passwd(1). delim off randomword(3)