Sponsored Content
Full Discussion: How to print first occurence
Top Forums UNIX for Dummies Questions & Answers How to print first occurence Post 302714567 by elixir_sinari on Friday 12th of October 2012 09:59:58 AM
Old 10-12-2012
I assume that you meant 17267 instead of 17262.
Code:
awk '/^17267/{sub(/.*\//,"",$5);print $5;exit(0)}' file


Last edited by elixir_sinari; 10-12-2012 at 11:07 AM..
 

10 More Discussions You Might Find Interesting

1. 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

2. 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

3. Shell Programming and Scripting

Print row if value in column 1 is the first occurence

Hi All, I would like to have a script which is able to perform the below. Print the whole row if column1 which is "0001" for the below example is the first occurrence. Subsequent "0001" occurrence will not be printed out and so on. Can any expert help ? Input: 0001 k= 40 0001 k= 2... (7 Replies)
Discussion started by: Raynon
7 Replies

4. Shell Programming and Scripting

HOW TO - Bash REGEX - Print Error when More then One Occurence is Found Consecutively?

Hello All, Bash Version: 4.1.10(1) I'm trying to "verify" some user input. The User input will contain the "Absolute Path" a "Command" and any "Options" of that Command. For Example, say the user's input is: user_input="/usr//local/myExample/check_process -p 'java' -w 10 -c 20" I... (6 Replies)
Discussion started by: mrm5102
6 Replies

5. Shell Programming and Scripting

sed print between 2 patterns only last occurence

Hi, I have a file, which contains the following log data. I am trying to print fromt he file the following data: I have tried using sed, but I am getting from the first pattern Thanks for your help. (5 Replies)
Discussion started by: sol_nov
5 Replies

6. 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

7. Shell Programming and Scripting

Help with using awk to print pattern/occurence

Hi, Do anybody know how to use awk to count the pattern at specific column? Input file M2A928K 419 ath-miR159a,gma-miR159a-3p,ptc-miR159a 60 miR235a . . Output file M2A928K 419 ath-miR159a,gma-miR159a-3p,ptc-miR159a 60 miR235a 3 . . I plan to count how many "miR" in column 3... (2 Replies)
Discussion started by: cpp_beginner
2 Replies

8. Shell Programming and Scripting

Match pattern and print the line number of occurence using awk

Hi, I have a simple problem but i guess stupid enough to figure it out. i have thousands rows of data. and i need to find match patterns of two columns and print the number of rows. for example: inputfile abd abp 123 abc abc 325 ndc ndc 451 mjk lkj... (3 Replies)
Discussion started by: redse171
3 Replies

9. Shell Programming and Scripting

[perl script] print the assembly instruction and count the occurence

Hi, I have a input file(text file) with the following lines. 0x000000 0x5a80 0x0060 BRA.l 0x60 ;file:UserCall.s ;function:_user_call_table ;C_sourceLine:24 0x000002 0x1bc5 RETI ;file:UserCall.s ;function:_user_call_table ;C_sourceLine:30 0x000003 0x6840 MOV R0L,R0L ;file:UserCall.s... (6 Replies)
Discussion started by: acdc
6 Replies

10. Shell Programming and Scripting

Print occurence number

Hi folks, I have a file with lots of lines in a text file,i need to print the occurence number after sorting based on the first column as shown below, thanks in advance. sam,dallas,20174 sam,houston,20175 sam,atlanta,20176 jack,raleigh,457865 jack,dc,7845 john,sacramento,4567 ... (4 Replies)
Discussion started by: tech_frk
4 Replies
Locale::Codes::LangExt(3pm)				 Perl Programmers Reference Guide			       Locale::Codes::LangExt(3pm)

NAME
Locale::Codes::LangExt - standard codes for language extension identification SYNOPSIS
use Locale::Codes::LangExt; $lext = code2langext('acm'); # $lext gets 'Mesopotamian Arabic' $code = langext2code('Mesopotamian Arabic'); # $code gets 'acm' @codes = all_langext_codes(); @names = all_langext_names(); DESCRIPTION
The "Locale::Codes::LangExt" module provides access to standard codes used for identifying language extensions, such as those as defined in the IANA language registry. Most of the routines take an optional additional argument which specifies the code set to use. If not specified, the default IANA language registry codes will be used. SUPPORTED CODE SETS
There are several different code sets you can use for identifying language extensions. A code set may be specified using either a name, or a constant that is automatically exported by this module. For example, the two are equivalent: $lext = code2langext('acm','alpha'); $lext = code2langext('acm',LOCALE_LANGEXT_ALPHA); The codesets currently supported are: alpha This is the set of three-letter (lowercase) codes from the IANA language registry, such as 'acm' for Mesopotamian Arabic. This is the default code set. ROUTINES
code2langext ( CODE [,CODESET] ) langext2code ( NAME [,CODESET] ) langext_code2code ( CODE ,CODESET ,CODESET2 ) all_langext_codes ( [CODESET] ) all_langext_names ( [CODESET] ) Locale::Codes::LangExt::rename_langext ( CODE ,NEW_NAME [,CODESET] ) Locale::Codes::LangExt::add_langext ( CODE ,NAME [,CODESET] ) Locale::Codes::LangExt::delete_langext ( CODE [,CODESET] ) Locale::Codes::LangExt::add_langext_alias ( NAME ,NEW_NAME ) Locale::Codes::LangExt::delete_langext_alias ( NAME ) Locale::Codes::LangExt::rename_langext_code ( CODE ,NEW_CODE [,CODESET] ) Locale::Codes::LangExt::add_langext_code_alias ( CODE ,NEW_CODE [,CODESET] ) Locale::Codes::LangExt::delete_langext_code_alias ( CODE [,CODESET] ) These routines are all documented in the Locale::Codes::API man page. SEE ALSO
Locale::Codes The Locale-Codes distribution. Locale::Codes::API The list of functions supported by this module. http://www.iana.org/assignments/language-subtag-registry The IANA language subtag registry. AUTHOR
See Locale::Codes for full author history. Currently maintained by Sullivan Beck (sbeck@cpan.org). COPYRIGHT
Copyright (c) 2011-2013 Sullivan Beck This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. perl v5.18.2 2013-11-04 Locale::Codes::LangExt(3pm)
All times are GMT -4. The time now is 08:18 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy