Sponsored Content
Full Discussion: First occurence from grep
Top Forums UNIX for Dummies Questions & Answers First occurence from grep Post 302133412 by namishtiwari on Thursday 23rd of August 2007 08:44:28 AM
Old 08-23-2007
Quote:
Originally Posted by sriram003
uniq filename

This will remove the duplicates.
Sriram,
Without understanding the problem please do not suggest anything and if want to give any suggestion stick to the problem.
anyway thaks for two wonderfull answers you gave.
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

grep for certain occurence

I am using grep to pull out info from a file. The line I am searching for begins: START TIME - Tue Sep 11 16:40:00. There are mutiple lines of START TIME. I need the FIRST occurence ONLY. My grep is as follows: start="$( grep 'START TIME' filename | cut -c15-33)" If I echo or cat... (2 Replies)
Discussion started by: app4dxh
2 Replies

2. UNIX for Dummies Questions & Answers

grep the last occurence

is there a grep or awk one-line command to print the line of the last occurence of a string in a file? (3 Replies)
Discussion started by: apalex
3 Replies

3. UNIX for Advanced & Expert Users

First Occurence

Hi, This is the format of the file that i have StartDate:10/01/06 EndDate :10/02/06 Cno Ccode 1 10 2 11 StartDate:10/03/06 EndDate :10/04/06 Cno Ccode 2 13 4 12 StartDate:10/01/06 EndDate :10/02/06 (5 Replies)
Discussion started by: kkm_job
5 Replies

4. Shell Programming and Scripting

Extracting the last occurence

Hi All, Is there any awk or unix command that i can make use such that the output will be as desired ? The code will extract the latest pattern starting from the term above the asterix till the end of the input Input: ******** aaa bbb 2007 ******** 123 234 134 ******** xxx yyy 2007... (9 Replies)
Discussion started by: Raynon
9 Replies

5. UNIX for Dummies Questions & Answers

grep the number of first occurence

File1.txt ....... ....... OMC LA OMC LK OMC LS ........ ........ Above is the content of File1.txt, i want to get the Number of Occurence to order, lets say if OMC LA = 1, OMC LS=3, and OMC LK=2.. omc_ident="OMC LA" or "OMC LK" or "OMC LS" omc_num=`grep '^OMC' File1.txt| grep... (4 Replies)
Discussion started by: neruppu
4 Replies

6. UNIX for Dummies Questions & Answers

number of occurence using grep -c then assigning it to a variable

Hi guys! I need to count the occurence of a certain pattern. For example the pattern is PC. the contents of the file sample.txt: A PC asdfgadfjkl asdfa PC sadfaf fdsPCasdfg if i use grep -c PC sample.txt it will display 3 as the number of occurence how do i save that number to a... (1 Reply)
Discussion started by: khestoi
1 Replies

7. Shell Programming and Scripting

Is there a way to grep the first occurence after a grep?

I have a text file: firstname: John lastname: Jay age: 33 firstname: Amy lastname: Jay age: 12 firstname: Max lastname: Jay age: 50 Currently I have first=`grep firstname file.txt | head -1` age=`grep -A 2 $name file.txt | tail -1` (7 Replies)
Discussion started by: etranman1
7 Replies

8. Shell Programming and Scripting

Percentage of occurence

Dear all, I have data like below and i need to add coloumn before the COUNT field to see the Percentage out of all COUNT field value for respective raw. ============================================= COUNT CODE sConnType tConnType... (6 Replies)
Discussion started by: Iroshan
6 Replies

9. Shell Programming and Scripting

Print between patterns - first occurence, second occurence etc

I have a file # cat asasas AAAAAA 11 22 33 44 BBBBB NILNILNIL AAAAAA 22 33 44 55 66 77 88 BBBBB NILNILNIL (2 Replies)
Discussion started by: anil510
2 Replies

10. Shell Programming and Scripting

Regex to match only first occurence with grep

Hello to all, How would be the correct regex to match only the first occurence of the pattern 3.*6. I'm trying with 3.*6 trying to match only 34rrte56, but with my current regex is matching 4rrte567890123456789123powiluur56. And if I try with ? doesn't print anything echo... (6 Replies)
Discussion started by: Ophiuchus
6 Replies
shishi_keys_to_keytab_file(3)					      shishi					     shishi_keys_to_keytab_file(3)

NAME
shishi_keys_to_keytab_file - API function SYNOPSIS
#include <shishi.h> int shishi_keys_to_keytab_file(Shishi * handle, Shishi_keys * keys, const char * filename); ARGUMENTS
Shishi * handle shishi handle as allocated by shishi_init(). Shishi_keys * keys keyset to write. const char * filename name of file to write. DESCRIPTION
Write keys to a MIT keytab data structure. The format of keytab's is proprietary, and this function writes the 0x0502 format. See the section The MIT Kerberos Keytab Binary File Format in the Shishi manual for a description of the reverse-engineered format. RETURNS
SHISHI_FOPEN_ERROR if there is a problem opening filename for writing, SHISHI_IO_ERROR if there is problem writing the file, and SHISHI_OK on success. SINCE
0.0.42 REPORTING BUGS
Report bugs to <bug-shishi@gnu.org>. COPYRIGHT
Copyright (C) 2002-2010 Simon Josefsson. Copying and distribution of this file, with or without modification, are permitted in any medium without royalty provided the copyright notice and this notice are preserved. SEE ALSO
The full documentation for shishi is maintained as a Texinfo manual. If the info and shishi programs are properly installed at your site, the command info shishi should give you access to the complete manual. shishi 1.0.1 shishi_keys_to_keytab_file(3)
All times are GMT -4. The time now is 07:08 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy