Count Number of Alternate Index


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Count Number of Alternate Index
# 1  
Old 06-05-2012
Count Number of Alternate Index

Hello People,

I have got a requirement to count the number of duplicate alternate Indexes present in a C-ISAM/IDXFORMAT(8) file.

Is there any utility that can furnish this information for the file? I am in need of the Alternate Index value and the number of times it appears as Alternate Index.
Eg:
AI_KEY1 1
AI_KEY2 5
AI_KEY3 2

Currently we are running a query on the file (in cyberquery tool) and calculating the count. But it takes long time to execute owing to the size of the file.
Please let me know for any relative informations.

Thanks for your help!!!
# 2  
Old 06-05-2012
If I understand your requirement correctly, the following should work.
Code:
cut -d\  -f1 your_file_name | sort | uniq -c

This User Gave Thanks to Skrynesaver For This Post:
# 3  
Old 06-05-2012
Quote:
Originally Posted by Skrynesaver
If I understand your requirement correctly, the following should work.
Code:
cut -d\  -f1 your_file_name | sort | uniq -c

Thanks. I'll give it a try and let you know if it fits the bill.

Btwn, I have two questions.
1. The file is an indexed file. If i run this command on the DAT part, it will work. Right? (I'll take care of the delimiter and field position in your command)
2. The file is of huge size. (>4 GB). Will this command lock the file when it is run? or is it just a READ mode operation.

Thanks much for your support!!!
# 4  
Old 06-11-2012
The rebuild command automatically picks up the Alternate key/primary key location. (after completing, in the info summery it says whether there is any duplicate primary/alternate key).

But in the cut command we have to manually specify it.

Is there any derivative of rebuild command which gives the number of alternate key value?

Thanks for your help in advance!!!
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Substitute string with an index number

Objective is to substitute Jan with 01, Feb with 02 and so on. The month will be provided as input. I could construct below awk and it worked. echo Jun | \ awk 'BEGIN{split("Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec",mon," ")}{ for (i=1;i<=12;i++){ if ($1==mon) printf("%02d\n",i)} }' ... (4 Replies)
Discussion started by: krishmaths
4 Replies

2. Shell Programming and Scripting

Print smallest negative number with corresponding index from a column

considering the following table: ID col1 col2 col3 col4 1 -16.06801249 13.49785832 -56.57087607 -27.00500526 2 -1.53315720 0.71731735 -42.03602078 -39.78554623 3 -1.53315190 0.71731587 -42.03601548 ... (3 Replies)
Discussion started by: Birda
3 Replies

3. Shell Programming and Scripting

extract the lines by index number

Hi All, I want to extract the lines from file1 by using the index numbers from file2. In example, cat file1.txt 265 ABC 956 ... 698 DFA 456 ... 456 DDD 145 ... 125 DSG 154 ... 459 CGB 156 ... 490 ASF 456 ... 484 XFH 489 ... 679 hgt 481 ... 111 dfg 986 ... 356 vhn 444 ...... (7 Replies)
Discussion started by: senayasma
7 Replies

4. Shell Programming and Scripting

how to add the number of row and count number of rows

Hi experts a have a very large file and I need to add two columns: the first one numbering the incidence of records and the another with the total count The input file: 21 2341 A 21 2341 A 21 2341 A 21 2341 C 21 2341 C 21 2341 C 21 2341 C 21 4567 A 21 4567 A 21 4567 C ... (6 Replies)
Discussion started by: juelillo
6 Replies

5. Shell Programming and Scripting

count the number of lines that start with the number

I have a file with contents similar to this. abcd 1234 4567 7666 jdjdjd 89289 9382 92 jksdj 9823 298 I want to write a shell script which count the number of lines that start with the number (disregard the lines starting with alphabets) (1 Reply)
Discussion started by: grajp002
1 Replies

6. Shell Programming and Scripting

Sort from start index and end index in line

Hi All, I have a file (FileNames.txt) which contains the following data in it. $ cat FileNames.txt MYFILE17XXX208Sep191307.csv MYFILE19XXX208Sep192124.csv MYFILE20XXX208Sep192418.csv MYFILE22XXX208Sep193234.csv MYFILE21XXX208Sep193018.csv MYFILE24XXX208Sep194053.csv... (5 Replies)
Discussion started by: krish_indus
5 Replies

7. Filesystems, Disks and Memory

why the inode index of file system starts from 1 unlike array index(0)

why do inode indices starts from 1 unlike array indexes which starts from 0 its a question from "the design of unix operating system" of maurice j bach id be glad if i get to know the answer quickly :) (0 Replies)
Discussion started by: sairamdevotee
0 Replies

8. Shell Programming and Scripting

Number count per number ranges

Hi, I have a question here that need to get advise from all of you. Let say I have a set of data 12347777 12359899 12347677 12360090 12347688 12359979 12359009 12367022 12346677 I need to count the number that appear in each numbering ranges and the output is like below: Prefix ... (5 Replies)
Discussion started by: shirleyeow
5 Replies

9. Shell Programming and Scripting

Write a shell program to find the sum of alternate digits in a given 5-digit number

Hi Can any one please post the answer for the above program.................. (4 Replies)
Discussion started by: banta
4 Replies

10. UNIX for Dummies Questions & Answers

need help getting console driver number(index)

Well, i have a little problem here. I am given device "console" of symbolical type. I do need to get its driver's number (index ?) Your help would be greatly appreciated thx, axujet (1 Reply)
Discussion started by: axujet
1 Replies
Login or Register to Ask a Question