02-03-2012
Quote:
Originally Posted by
radoulov
OK,
in this case the code I've provided is sufficient, isn't it?
I think so. But, my only question is that will your code matches numbers in the first three columns. Because, when u wrote the code all u had was alphabets.
Thanks for all ur help.
Sorry mods for somehow overlooking to include the code tags.
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
hey guys, I have two files both with two columns, I have already created an
awk code to ignore certain lines (e.g lines that start with 963) as they wou
ld begin with a certain string, however, the rest I have added together and
calculated the average.
At the moment the code also displays... (3 Replies)
Discussion started by: chlfc
3 Replies
2. Shell Programming and Scripting
I have two files like this:
#FILE 1
ABCD 4322 26485
JMTJ 5311 97248
XMPJ 4321 58978
#FILE 2
ABCD 4321 26485
JMTJ 5311 97248
XMPJ 4321 68978
What to do: Compare the two files and find those lines that doesn't match. And have a new file like this:
#FILE 3
"from file 1"
ABCD 4322 26485... (11 Replies)
Discussion started by: kingpeejay
11 Replies
3. Shell Programming and Scripting
Hi,
i have an input text file like this:
Student 1
maths
science
=
Student 2
maths
science
=
Student 3
maths
science
i would like to print each student information into separate files, each student id is separated by "=". (1 Reply)
Discussion started by: saint2006
1 Replies
4. Shell Programming and Scripting
Hi.
I have a tab separated file that has a couple nearly identical lines. When doing:
sort file | uniq > file.new
It passes through the nearly identical lines because, well, they still are unique.
a)
I want to look only at field x for uniqueness and if the content in field x is the... (1 Reply)
Discussion started by: rocket_dog
1 Replies
5. Shell Programming and Scripting
hi
my problem is little complicated one. i have 2 files which appear like this
file 1
abbsss:aa:22:34:as akl abc 1234
mkilll:as:ss:23:qs asc abc 0987
mlopii:cd:wq:24:as asd abc 7866
file2
lkoaa:as:24:32:sa alk abc 3245
lkmo:as:34:43:qs qsa abc 0987
kloia:ds:45:56:sa acq abc 7805
i... (5 Replies)
Discussion started by: anurupa777
5 Replies
6. Shell Programming and Scripting
Good morning all,
I have a problem that is one step beyond a standard awk compare.
I would like to compare three files which have several thousand records against a fourth file. All of them have a value in each row that is identical, and one value in each of those rows which may be duplicated... (1 Reply)
Discussion started by: nashton
1 Replies
7. UNIX for Dummies Questions & Answers
I would like to print unique lines without sort or unique. Unfortunately the server I am working on does not have sort or unique. I have not been able to contact the administrator of the server to ask him to add it for several weeks. (7 Replies)
Discussion started by: cokedude
7 Replies
8. Shell Programming and Scripting
Hi,
I have multiple files that each contain one column of strings:
File1:
123abc
456def
789ghi
File2:
123abc
456def
891jkl
File3:
234mno
123abc
456def
In total I have 25 of these type of file. (5 Replies)
Discussion started by: owwow14
5 Replies
9. Shell Programming and Scripting
Hello,
I would like to ask for help with csh script.
An example of an input in .txt file is below, the number of lines varies from file to file and I have 2 or 3 columns with values. I would like to read all the values (probably one by one) and set them to independent unique variables that... (7 Replies)
Discussion started by: FMMOLA
7 Replies
10. UNIX for Beginners Questions & Answers
I have a directory of files, I can show the number of lines in each file and order them from lowest to highest with:
wc -l *|sort
15263 Image.txt
16401 reference.txt
40459 richtexteditor.txt
How can I also print the number of unique lines in each file?
15263 1401 Image.txt
16401... (15 Replies)
Discussion started by: spacegoose
15 Replies
LEARN ABOUT REDHAT
ldap_mods_free
LDAP_MODIFY(3) Library Functions Manual LDAP_MODIFY(3)
NAME
ldap_modify, ldap_modify_s - Perform an LDAP modify operation
SYNOPSIS
#include <ldap.h>
int ldap_modify(ld, dn, mods)
LDAP *ld;
char *dn;
LDAPMod *mods[];
int ldap_modify_s(ld, dn, mods)
LDAP *ld;
char *dn;
LDAPMod *mods[];
void ldap_mods_free( mods, freemods )
LDAPMod **mods;
int freemods;
DESCRIPTION
The routine ldap_modify_s() is used to perform an LDAP modify operation. dn is the DN of the entry to modify, and mods is a null-termi-
nated array of modifications to make to the entry. Each element of the mods array is a pointer to an LDAPMod structure, which is defined
below.
typedef struct ldapmod {
int mod_op;
char *mod_type;
union {
char **modv_strvals;
struct berval **modv_bvals;
} mod_vals;
struct ldapmod *mod_next;
} LDAPMod;
#define mod_values mod_vals.modv_strvals
#define mod_bvalues mod_vals.modv_bvals
The mod_op field is used to specify the type of modification to perform and should be one of LDAP_MOD_ADD, LDAP_MOD_DELETE, or
LDAP_MOD_REPLACE. The mod_type and mod_values fields specify the attribute type to modify and a null-terminated array of values to add,
delete, or replace respectively. The mod_next field is used only by the LDAP server and may be ignored by the client.
If you need to specify a non-string value (e.g., to add a photo or audio attribute value), you should set mod_op to the logical OR of the
operation as above (e.g., LDAP_MOD_REPLACE) and the constant LDAP_MOD_BVALUES. In this case, mod_bvalues should be used instead of
mod_values, and it should point to a null-terminated array of struct bervals, as defined in <lber.h>.
For LDAP_MOD_ADD modifications, the given values are added to the entry, creating the attribute if necessary. For LDAP_MOD_DELETE modifi-
cations, the given values are deleted from the entry, removing the attribute if no values remain. If the entire attribute is to be
deleted, the mod_values field should be set to NULL. For LDAP_MOD_REPLACE modifications, the attribute will have the listed values after
the modification, having been created if necessary. All modifications are performed in the order in which they are listed.
ldap_modify_s() returns the LDAP error code resulting from the modify operation. This code can be interpreted by ldap_perror(3) and
friends.
The ldap_modify() operation works the same way as ldap_modify_s(), except that it is asynchronous, returning the message id of the request
it initiates, or -1 on error. The result of the operation can be obtained by calling ldap_result(3).
ldap_mods_free() can be used to free each element of a NULL-terminated array of mod structures. If freemods is non-zero, the mods pointer
itself is freed as well.
ERRORS
ldap_modify_s() returns an ldap error code, either LDAP_SUCCESS or an error if there was trouble. ldap_modify() returns -1 in case of
trouble, setting the ld_errno field of ld.
SEE ALSO
ldap(3), ldap_error(3), ldap_add(3)
ACKNOWLEDGEMENTS
OpenLDAP is developed and maintained by The OpenLDAP Project (http://www.openldap.org/). OpenLDAP is derived from University of Michigan
LDAP 3.3 Release.
OpenLDAP 2.0.27-Release 22 September 1998 LDAP_MODIFY(3)