Sponsored Content
Full Discussion: sorting null values
Top Forums Shell Programming and Scripting sorting null values Post 302405541 by vickyhere on Friday 19th of March 2010 05:40:56 AM
Old 03-19-2010
Thanks Alister !
those are empty lines lets say that empty line contain tabs or space.
but i need those tab/space at the EOF.


Regards,
Vicky
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

handling null values in files

Hi , I have a script where i will remove header and trailer record and ftp to another server. I'm using the code: latestfilename=`ls filename_* | tail -1` echo "Latest filename = $latestfilename" sed '1d;$d' $latestfilename > a.ftpedfile I have an issue if input data is having null... (1 Reply)
Discussion started by: ammu
1 Replies

2. Shell Programming and Scripting

comparing the null values in the unix

hi all, iam new to this forum.i have to submit the script EOD.so please help me. my requirement is to compare two null values..iam trying to compare two null values :One null value output of the storedprocedure and another iam giving spaces in script. it is giving the error... (11 Replies)
Discussion started by: bbc17484
11 Replies

3. Shell Programming and Scripting

identifying null values in a file

I have a huge file with 20 fileds in each record and each field is seperated by "|". If i want to get all the reocrds that have 18th or for that matter any filed as null how can i do it? Please let me know (3 Replies)
Discussion started by: dsravan
3 Replies

4. UNIX for Dummies Questions & Answers

Check for null values in a column

Hi All, I have a file with 10 columns and get the required data for nine columns properly except 8th. In 8th column i have both NULL and NON NULL values...i.e certain records have values for all the columns including 8th column and certain records have 8th column as NULL.My requisite is,without... (20 Replies)
Discussion started by: ganesh_248
20 Replies

5. UNIX for Advanced & Expert Users

How to Compare Null values??

Hi, Can someone help me comparing Null values. Scenario is as follows: I have a variable which "cache_prd" which can have either some integer or nothing(Null) if it is integer I have to again do some comparision but these comparisons give me this error:( "line 32: [: 95: unary operator... (3 Replies)
Discussion started by: Yagami
3 Replies

6. Shell Programming and Scripting

Averaging each row with null values

Hi all, I want to compute for the average of a file with null values (NaN) for each row. any help on how to do it. the sample file looks like this. 1.4 1.2 1.5 NaN 1.6 1.3 1.1 NaN 1.3 NaN 2.4 1.3 1.5 NaN 1.5 NaN 1.2 NaN 1.4 NaN I need to do a row-wise averaging such that it will sum only... (14 Replies)
Discussion started by: ida1215
14 Replies

7. Shell Programming and Scripting

How to use sort with null values?

Hello everyone I am doing a join command. Obviously, before I need two files sorted first. ( Both files have headers and have about 2 million lines each one ) The problem is, one of the files has null values in the key to sort (which is the first filed ). For example I have the original... (4 Replies)
Discussion started by: viktor1985
4 Replies

8. Shell Programming and Scripting

Handle null values-awk

I am using below code to validate the source file,code working fine but if any column contains null value then below code throwing error actually it should not.how to customize the below code to handle null null values also. When I run the script with below source data getting “date error”, as... (2 Replies)
Discussion started by: srivalli
2 Replies

9. Shell Programming and Scripting

Check null values column

hi, I had a small question.I had a file from which i need to extract data. I have written the below script to check if the file exists and if it exists extract requierd columns from the file. IFILE=/home/home01/Report_1.csv OFILE=/home/home01/name.csv.out1 if #Checks if file exists... (1 Reply)
Discussion started by: Vivekit82
1 Replies

10. Shell Programming and Scripting

Printing null values in awk

Hi, I have a csv file with given details abc.txt 123,ra,point,,there 232,ba,points,home,pheer I want to get those values and store them in different variables: Code: while read line do echo $line |awk -F"," '{print $1" "$2" "$3" "$4" "$5"}'|read dbt_acct val_dt crncy AMT... (11 Replies)
Discussion started by: rahulsk
11 Replies
LDAP_SORT(3)						     Library Functions Manual						      LDAP_SORT(3)

NAME
ldap_sort_entries, ldap_sort_values, ldap_sort_strcasecmp - LDAP sorting routines SYNOPSIS
#include <ldap.h> ldap_sort_entries(ld, chain, attr, cmp) LDAP *ld; LDAPMessage **chain; char *attr; int (*cmp)(); ldap_sort_values(ld, vals, cmp) LDAP *ld; char **vals; int (*cmp)(); ldap_sort_strcasecmp(a, b) char *a; char *b; DESCRIPTION
These routines are used to sort lists of entries and values retrieved from an LDAP server. ldap_sort_entries() is used to sort a chain of entries retrieved from an LDAP search call either by DN or by some arbitrary attribute in the entries. It takes ld, the LDAP structure, which is only used for error reporting, chain, the list of entries as returned by ldap_search_s(3) or ldap_result(3). attr is the attribute to use as a key in the sort or NULL to sort by DN, and cmp is the comparison function to use when comparing values (or individual DN components if sorting by DN). In this case, cmp should be a function taking two single values of the attr to sort by, and returning a value less than zero, equal to zero, or greater than zero, depending on whether the first argument is less than, equal to, or greater than the second argument. The convention is the same as used by qsort(3), which is called to do the actual sorting. ldap_sort_values() is used to sort an array of values from an entry, as returned by ldap_get_values(3). It takes the LDAP connection structure ld, the array of values to sort vals, and cmp, the comparison function to use during the sort. Note that cmp will be passed a pointer to each element in the vals array, so if you pass the normal char ** for this parameter, cmp should take two char **'s as arguments (i.e., you cannot pass strcasecmp or its friends for cmp). You can, however, pass the function ldap_sort_strcasecmp() for this purpose. For example: LDAP *ld; LDAPMessage *res; /* ... call to ldap_search_s(), fill in res, retrieve sn attr ... */ /* now sort the entries on surname attribute */ if ( ldap_sort_entries( ld, &res, "sn", ldap_sort_strcasecmp ) != 0 ) ldap_perror( ld, "ldap_sort_entries" ); NOTES
The ldap_sort_entries() routine applies the comparison function to each value of the attribute in the array as returned by a call to ldap_get_values(3), until a mismatch is found. This works fine for single-valued attributes, but may produce unexpected results for multi- valued attributes. When sorting by DN, the comparison function is applied to an exploded version of the DN, without types. The return values for all of these functions are declared in the <ldap.h> header file. Some routines may dynamically allocate memory. Callers are responsible for freeing such memory using the supplied deallocation routines. SEE ALSO
ldap(3), ldap_search(3), ldap_result(3), qsort(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_SORT(3)
All times are GMT -4. The time now is 08:09 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy