10-15-2013
What do you consider "much larger"? A hundred lines? A thousand? A million? A billion? A simple solution may scale from 12 to 1000, but perhaps not to a million and beyond.
It would be a shame for someone to waste their time crafting code that can never be used because it takes forever to complete or because it requires more memory than the system has available. So, please, be more precise than "much larger". Also, if the file can approach the size of your system's memory, you should definitely mention that.
Regards,
Alister
9 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
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
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
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
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
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
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
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
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
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
LEARN ABOUT ULTRIX
tdelete
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)