Sponsored Content
Top Forums Shell Programming and Scripting Looping in case of duplicates Post 302863973 by barath on Tuesday 15th of October 2013 01:33:15 PM
Old 10-15-2013
Sorry for the inconvenience......much larger doesn't meant here that it can go to thousand or million lines...the above code is crafted on the basis of similar kind(datalins1.dat) of input scenario...

Thanks
 

9 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

lower case to upper case string conversion in shell script

How can convert a Lower case variable value to an upper case in the kron shell script. (3 Replies)
Discussion started by: dchalavadi
3 Replies

2. Shell Programming and Scripting

Script needed to select and delete lower case and mixed case records

HELLO ALL, URGENTLY NEEDED A SCRIPT TO SELECT AND DELETE LOWER AND MIXED CASE RECORDS FROM A COLUMN IN A TABLE. FOR EXAMPLE : Table name is EMPLOYEE and the column name is CITY and the CITY column records will be: Newyork washington ... (1 Reply)
Discussion started by: abhilash mn
1 Replies

3. SCO

Avoiding duplicates with some special case

Hi Gurus, I had a question regarding avoiding duplicates.i have a file abc.txt abc.txt ------- READER_1_1_1> HIER_28056 XML Reader: Error occurred while parsing:; line number ; column number READER_1_3_1> Sun Mar 23 23:52:48 2008 READER_1_3_1> HIER_28056 XML Reader: Error occurred while... (0 Replies)
Discussion started by: pssandeep
0 Replies

4. Shell Programming and Scripting

data array needs to change upper case to lower case

Hi all, i have a data array as followes. ARRAY=DFSG345GGG ARRAY=234FDFG090 ARRAY=VDFVGBGHH so on.......... i need all english letters to be change to lower case. So i am expecting to see ARRAY=dfsg345ggg ARRAY=234fdfg090 ARRAY=vdfvgbghh so on........ If i have to copy this data in... (8 Replies)
Discussion started by: usustarr
8 Replies

5. Shell Programming and Scripting

sed ignoring case for search but respecting case for subtitute

Hi I want to make string substitution ignoring case for search but respecting case for subtitute. Ex changing all occurences of "original" in a file to "substitute": original becomes substitute Origninal becomes Substitute ORIGINAL becomes SUBSTITUTE I know this a little special but it's not... (1 Reply)
Discussion started by: kmchen
1 Replies

6. Shell Programming and Scripting

Conversion from Upper Case to Lower Case Condition based

Hello Unix Gurus : It would be really appreciative if can find a solution for this . I have records in a file . I need to Capitalize the records based on condition . For Example i tried the following Command COMMAND --> fgrep "2000YUYU" /export/home/oracle/TST/data.dat | tr '' ''... (12 Replies)
Discussion started by: tsbiju
12 Replies

7. Shell Programming and Scripting

multiple looping with case and funtion showing error, Please help

Hello All, I have code as follows :- while true do {opening a case1 statement} 1) {opening another case2 statement} {closing case 2} 2) Showing error for "2)" as Syntax error at line 59 : `)' is not expected. *) {closing case 1} ... (5 Replies)
Discussion started by: Renjesh
5 Replies

8. Shell Programming and Scripting

Looping in case of duplicates ...

complinagetest () #function name { if ;then rm complins.dat fi touch complins.dat i=0 while read line do if ; then va=`grep -w "$line" datalins1.dat | awk BEGIN'{FS="\`~"}{if ( $3=="'$line'" ) {print $4}}'` i=$(($i+1)) varits=$(echo $va|awk -v varif="$i" '{print... (1 Reply)
Discussion started by: amitpaul01
1 Replies

9. Shell Programming and Scripting

Change first letter of a word from lower case to upper case

Hi all, I am trying to find a way to change first letter in a word from lower case to upper case. It should be done for each first word in text or in paragraph, and also for each word after punctuation like . ; : ! ?I found the following command sed -i 's/\s*./\U&\E/g' $@ filenamebut... (7 Replies)
Discussion started by: georgi58
7 Replies
tsearch(3)						     Library Functions Manual							tsearch(3)

Name
       tsearch, tfind, tdelete, twalk - manage binary search trees

Syntax
       #include <search.h>

       void *tsearch (key, rootp, compar)
       void *key;
       void **rootp;
       int (*compar)( );

       void *tfind (key, rootp, compar)
       void *key;
       void **rootp;
       int (*compar)( );

       void *tdelete (key, rootp, compar)
       void *key;
       void **rootp;
       int (*compar)( );

       void twalk (root, action)
       void * root;
       void (*action)( );

Description
       The  subroutine	is  a  binary tree search routine generalized from Knuth (6.2.2) Algorithm T.  It returns a pointer into a tree indicating
       where a datum may be found.  If the datum does not occur, it is added at an appropriate point in the tree.  The key points to the datum	to
       be  sought in the tree.	The rootp points to a variable that points to the root of the tree.  A NULL pointer value for the variable denotes
       an empty tree; in this case, the variable will be set to point to the datum at the root of the new tree.  The compar is	the  name  of  the
       comparison  function.  It is called with two arguments that point to the elements being compared.  The function must return an integer less
       than, equal to, or greater than zero according as the first argument is to be considered less than, equal to, or greater than the second.

       Like will search for a datum in the tree, returning a pointer to it if found.  However, if it is not found, will  return  a  NULL  pointer.
       The arguments for are the same as for

       The  subroutine deletes a node from a binary search tree.  It is generalized from Knuth (6.2.2) algorithm D.  The arguments are the same as
       for The variable pointed to by rootp will be changed if the deleted node was the root of the tree.  The subroutine returns a pointer to the
       parent of the deleted node, or a NULL pointer if the node is not found.

       The  subroutine	traverses a binary search tree.  The root is the root of the tree to be traversed.  (Any node in a tree may be used as the
       root for a walk below that node.)  The action is the name of a routine to be invoked at each node.  This routine is, in turn,  called  with
       three  arguments.   The	first  argument is the address of the node being visited.  The second argument is a value from an enumeration data
       type typedef enum { preorder, postorder, endorder, leaf } VISIT; (defined in the <search.h> header file), depending on whether this is  the
       first, second or third time that the node has been visited (during a depth-first, left-to-right traversal of the tree), or whether the node
       is a leaf.  The third argument is the level of the node in the tree, with the root being level zero.  The pointers to the key and the  root
       of the tree should be of type pointer-to-element, and cast to type pointer-to-character.

       The  comparison	function  need	not compare every byte, so arbitrary data may be contained in the elements in addition to the values being
       compared.

       Although declared as type pointer-to-character, the value returned should be cast into type pointer-to-element.

       Note that the root argument to is one level of indirection less than the rootp arguments to and

Return Values
       A NULL pointer is returned by if there is not enough space available to create a new node.
       A NULL pointer is returned by and if rootp is NULL on entry.
       If the datum is found, both and return a pointer to it.	If not, returns NULL, and returns a pointer to the inserted item.

Restrictions
       Results are unpredictable if the calling function alters the pointer to the root.

Diagnostics
       A NULL pointer is returned by and if rootp is NULL on entry.

See Also
       bsearch(3), hsearch(3), lsearch(3)

																	tsearch(3)
All times are GMT -4. The time now is 09:32 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy