Except for the formatting, how far would this get you:
Please note, that
Quote:
awk's behavior is to give precedence to the last line number in an array when one of its elements is repeated
does not quite accurately describe the situation - array elements are just overwritten when indices are encountered another time(s), and awk does this as any other programming language.
Hello!
I am writing a program to run through two large lists of data (~300,000 rows), find where rows in one file match another, and combine them based on matching fields. Due to the large file sizes, I'm guessing AWK will be the most efficient way to do this. Overall, the input and output I'm... (5 Replies)
Hi every one;
I have a 31500-line text file upon which two following tasks are to be performed:
1: Rearranging the file
2: Taking the average of each column (considering number of zeros) and output the result into a new file
This is the code I've come up with:
awk '(NR%3150<3150)... (0 Replies)
Hi All,
I have 2 files (file1 & file2).
File1 and File2 have m and n columns respectively
I have to compare value in column1 of file1 with file2 and find line(s) from file2 matching column1 value.
The value can be in any column in the matching lines of file2.
The output should be... (10 Replies)
I am newbie to unix and would please like some help to solve the task below
I have two files, file_a.text and file_b.text that I want to evaluate.
file_a.text
1698.74
1711.88
6576.25
899.41
3205.63
4187.98
697.35
1551.83 ... (3 Replies)
Hi,
I am working with two tab-delimited files with multiple columns, formatted as follows:
File 1:
>chrom 1 100 A G 20 …(10 columns)
>chrom 1 104 G C 18 …(10 columns)
>chrom 2 28 T C ... (4 Replies)
Hi,
Please excuse for often requesting queries and making R&D, I am trying to work out a possibility where i have two files field separated by pipe and another file containing only one field where there is no matching columns, Could you please advise how to merge two files.
$more... (3 Replies)
Hi everyone,
Given two files (test1 and test2) with the following contents:
test1:
80263760,I71
80267369,M44
80274628,L77
80276793,I32
80277390,K05
80277391,I06
80279206,I43
80279859,K37
80279866,K35
80279867,J16
80280346,I14and test2:
80263760,PT18
80279867,PT01I need to do some... (3 Replies)
Hi,
I have 2 tab-delimited input files as follows.
file1.tab:
green A apple
red B apple
file2.tab:
apple - A;Z
Objective:
Return $1 of file1 if,
. $1 of file2 matches $3 of file1 and,
. any single element (separated by ";") in $3 of file2 is present in $2 of file1
In order to... (3 Replies)
Long time listener first time poster. Hope someone can advise.
I have two files, 1000+ lines in each, two fields in each file.
After performing a sort, what is the best way to find exact matches where field $1 and $2 in file1 are also present in file2 on the same line, then output only those... (6 Replies)
Hello all, I am having trouble with what should be an easy task, but seem to be missing something fundamental. I have two files, with File 1 consisting of a single field of many thousands of records. I also have File 2 with two fields and many thousands of records.
My goal is that when $1 of... (2 Replies)
Discussion started by: jvoot
2 Replies
LEARN ABOUT DEBIAN
rlm_passwd
rlm_passwd(5) FreeRADIUS Module rlm_passwd(5)NAME
rlm_passwd - FreeRADIUS Module
DESCRIPTION
The rlm_passwd module provides authorization via files similar in format to /etc/passwd.
The lm_passwd module allows you to retrieve any account information from any files with passwd-like format (/etc/passwd, /etc/group, smb-
passwd, .htpasswd, etc). Every field of the file may be mapped to a RADIUS attribute, with one of the fields used as a key.
The module reads the file when it initializes, and caches the data in memory. As a result, it does not support dynamic updates of the
files (the server has to be HUP'd), but it is very fast, even for files with thousands of lines.
The configuration item(s):
filename
The path to the file.
delimiter = ":"
The character to use as a delimiter between fields. The default is ":"
hashsize
The size of the hashtable. If 0, then the passwords are not cached and the passwd file is parsed for every request. We do not rec-
ommend such a configuration. A larger hashsize means less probability of collision and faster search in hashtable. Having a hash-
size in the range of 30-100% of the number of passwd file records is reasonable.
allowmultiplekeys
If set to 'yes', and more than one record in file matches the request, then the attributes from all records will be used. If set to
'no' (the default) the module will warn about duplicated records.
ignorenislike
If set to 'yes', then all records from the file beginning with the '+' sign will be ignored. The default is 'no'.
format The format of the fields in the file, given as an example line from the file, with the content of the fields as the RADIUS
attributes which the fields map to. The fields are seperated by the ':' character.
The key field is signified by being preceded with a '*' character, which indicates that the field has only one key, like the /etc/passwd
file. The key field may instead be preceded with '*,', which indicates that the field has multiple possible keys, like the /etc/group
file.
The other fields signify RADIUS attributes which, by default, are added to the configuration items for a request.
To add an attribute to the request (as though it was sent by the NAS), prefix the attribute name in the "format" string with the '~' char-
acter.
To add an attribute to the reply (to be sent back to the NAS) prefix the attribute name in the "format" string with the '=' character.
ignoreempty
This configuration item defaults to "yes". If there is no value for the attribute, then the attribute is not added. By setting
this value to "no", you can force the attribute to be added, even if there is no value.
EXAMPLES
format = "My-Group:::*,User-Name"
Parse a file similar to the /etc/group file. An entry matches a request when the name in a User-Name attribute exists in the comma-
seperated list of a line in the file. When an entry matches, a "My-Group" attribute will be created and added to the configuration
items for the request. The value of that attribute will be taken from the first field of the matching line in the file.
The ":::" in the format string means that there are extra two fields in the line, in between the group name and list of user names.
Those fields do not map to any RADIUS attribute, and are therefore ignored.
For this example to work in practice, you will have to add the My-Group attribute to the dictionary file. See the dictionary manual
page for details on how this may be done.
format = "~My-Group:::*,User-Name"
Similar to the previous entry, except the My-Group attribute is added to the request, as though it was sent by the NAS.
SECTIONS
authorize
FILES
/etc/raddb/radiusd.conf
SEE ALSO radiusd(8), radiusd.conf(5)dictionary(5),
AUTHOR
Alan DeKok <aland@freeradius.org>
14 April 2004 rlm_passwd(5)