Sponsored Content
Top Forums Shell Programming and Scripting Awk: Matching Pattern From other file with length Post 302943608 by disedorgue on Monday 11th of May 2015 05:39:06 AM
Old 05-11-2015
Hi, Can you try to replace your "if condition" by:
Code:
 if($1 ~ "^"i && length($1) >=SHTMINL[i] && length($1) <=SHTMAXL[i])

Regards.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

AWK pattern matching, first and last

In a nutshell, I need to work out how to return the last matching pattern from an awk //,// search. I can bring back the first, but am unsure how to obtain the last, and a simple tail won't work as the match could be over multiple lines. Secondly I would like some way of pattern matching, a... (10 Replies)
Discussion started by: smb_uk
10 Replies

2. Shell Programming and Scripting

pattern matching using awk.

Dear Team, How do we match two patterns on the same line using awk?Are there any logical operators which i could use in awk like awk '\gokul && chennai\' <filename> Eg: Input file: gokul,10/11/1986,coimbatore. gokul,10/11/1986,bangalore. gokul,12/04/2008,chennai.... (2 Replies)
Discussion started by: gokulj
2 Replies

3. Shell Programming and Scripting

AWK pattern matching

Hi, How can I tell awk to print all lines/columns if column number 5 contains the word Monday? I have tried nawk -F, '$5==Monday' OFS=, myfile > outputfile but that doesn't work (I am a newb!!) Thanks, (7 Replies)
Discussion started by: keenboy100
7 Replies

4. UNIX for Dummies Questions & Answers

awk - pattern matching?

Hello all, I am trying to sort thru a database and print all the customers whose first names are only four characters. I just want to pull the first name only from the database. the database records appear like this in file: Mike Harrington:(510) 548-1278:250:100:175; first is name Mike... (4 Replies)
Discussion started by: citizencro
4 Replies

5. Shell Programming and Scripting

awk - writing matching pattern to a new file and deleting it from the current file

Hello , I have comma delimited file with over 20 fileds that i need to do some validations on. I have to check if certain fields are null and then write the line containing the null field into a new file and then delete the line from the current file. Can someone tell me how i could go... (2 Replies)
Discussion started by: goddevil
2 Replies

6. Shell Programming and Scripting

awk pattern matching

can somebody provide me with some ksh code that will return true if my the contents in my variable match anyone of these strings ORA|ERROR|SP2 variable="Error:ORA-01017: Invalid username/password; logon denied\nSP2-0640:Not connected" I tried this and it does not seem to work for me ... (3 Replies)
Discussion started by: BeefStu
3 Replies

7. Shell Programming and Scripting

Pattern matching using awk

Hi I am trying to find a pattern match with column one containing 3 numbers. input file tmp.lst abcd456|1|23123|123123|23423 kumadff|a|dadfadf|adfd|adfadfadf xxxd999|d|adfdfs|adfadf|adfdasfadf admin|a|dafdf|adfadfa||| output file tmp4.lst abcd456|1|23123|123123|23423... (3 Replies)
Discussion started by: vamsekumar
3 Replies

8. Shell Programming and Scripting

awk pattern matching

I have two files, want to compare file1 data with file2 second column and print line which are not matching. Need help in matching the pattern, file2 second column number can be leading 0 or 00 or 000. Example: file1 1 2 3 file2 a,0001 b,02 c,000 d,01 e,2 f,0005 Expected output:... (20 Replies)
Discussion started by: vegasluxor
20 Replies

9. Shell Programming and Scripting

Big pattern file matching within another pattern file in awk or shell

Hi I need to do a patten match between files . I am new to shell scripting and have come up with this so far. It take 50 seconds to process files of 2mb size . I need to tune this code as file size will be around 50mb and need to save time. Main issue is that I need to search the pattern from... (2 Replies)
Discussion started by: nitin_daharwal
2 Replies

10. Shell Programming and Scripting

Using awk to add length of matching characters between field in file

The awk below produces the current output, which will add +1 to $3. However, I am trying to add the length of the matching characters between $5 and $6 to $3. I have tried using sub as a variable to store the length but am not able to do so correctly. I added comments to each line and the... (4 Replies)
Discussion started by: cmccabe
4 Replies
LCG_LIMITS(4)							   File Formats 						     LCG_LIMITS(4)

NAME
Castor_limits - LCG internal limits SYNOPSIS
#include <Castor_limits.h> DESCRIPTION
The Castor_limits.h header file contains all the common limits that all LCG subpackages have to respect. These are: CA_MAXACLENTRIES maximum number of ACL entries for a file/dir Default value: 300 CA_MAXCLASNAMELEN maximum length for a fileclass name Default value: 15 CA_MAXCOMMENTLEN maximum length for user comments in metadata Default value: 255 CA_MAXDENFIELDS maximum number of density values in devinfo Default value: 8 CA_MAXDENLEN maximum length for a alphanumeric density Default value: 8 CA_MAXDGNLEN maximum length for a device group name Default value: 6 CA_MAXDPMTOKENLEN maximum length for a Disk Pool Manager token Default value: 36 CA_MAXDVNLEN maximum length for a device name Default value: 63 CA_MAXDVTLEN maximum length for a device type Default value: 8 CA_MAXFIDLEN maximum length for a fid (DSN) Default value: 17 CA_MAXFSEQLEN maximum length for a fseq string Default value: 14 CA_MAXGID maximum value for gid Default value: 0x7FFFFFFF CA_MAXGRPNAMELEN maximum length for a group name Default value: 2 CA_MAXGUIDLEN maximum length for a guid Default value: 36 CA_MAXHOSTNAMELEN maximum length for a hostname Default value: 63 CA_MAXLBLTYPLEN maximum length for a label type Default value: 3 CA_MAXLINELEN maximum length for a line in a log Default value: 1023 CA_MAXMANUFLEN maximum length for a cartridge manufacturer Default value: 12 CA_MAXMLLEN maximum length for a cartridge media_letter Default value: 1 CA_MAXMODELLEN maximum length for a cartridge model Default value: 6 CA_MAXNAMELEN maximum length for a pathname component Default value: 255 CA_MAXNBDRIVES maximum number of tape drives per server Default value: 32 CA_MAXPATHLEN maximum length for a pathname Default value: 1023 CA_MAXPOLICYLEN maximum length for a policy name Default value: 15 CA_MAXPOOLNAMELEN maximum length for a pool name Default value: 15 CA_MAXPROTOLEN maximum length for a protocol name Default value: 7 CA_MAXRBTNAMELEN maximum length for a robot name Default value: 17 CA_MAXRECFMLEN maximum length for a record format Default value: 3 CA_MAXREGEXPLEN maximum length for a regular expression Default value: 63 CA_MAXSFNLEN maximum length for a replica Default value: 1103 CA_MAXSHORTHOSTLEN maximum length for a hostname without domain Default value: 10 CA_MAXSNLEN maximum length for a cartridge serial nb Default value: 24 CA_MAXSTGRIDLEN maximum length for a stager full request id (must be >= nb digits in CA_MAXSTGREQID + CA_MAXHOSTNAMELEN + 8) Default value: 77 CA_MAXSTGREQID maximum value for a stager request id Default value: 999999 CA_MAXUID maximum value for uid Default value: 0x7FFFFFFF CA_MAXSYMLINKS maximum number of symbolic links Default value: 5 CA_MAXTAGLEN maximum length for a volume tag Default value: 255 CA_MAXTAPELIBLEN maximum length for a tape library name Default value: 8 CA_MAXUNMLEN maximum length for a drive name Default value: 8 CA_MAXUSRNAMELEN maximum length for a login name Default value: 14 CA_MAXVIDLEN maximum length for a VID Default value: 6 CA_MAXVSNLEN maximum length for a VSN Default value: 6 AUTHOR
LCG Grid Deployment Team LCG
$Date: 2007/02/03 11:16:45 $ LCG_LIMITS(4)
All times are GMT -4. The time now is 10:41 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy