Sponsored Content
Full Discussion: How to print first occurence
Top Forums UNIX for Dummies Questions & Answers How to print first occurence Post 302714835 by pamu on Friday 12th of October 2012 10:17:50 PM
Old 10-12-2012
Or

Code:
awk -F/ '/^17267/{split($NF,a," ");print a[1];exit(0)}' file

 

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
NPRINT(1)							      nprint								 NPRINT(1)

NAME
nprint - NetWare print client SYNOPSIS
nprint [ -S server ] [ -h ] [ -U username | -n ] [ -C ] [ -q queuename ] [ -d job-description ] [ -p pathname-in-banner ] [ -B username-in- banner ] [ -s ] [ -f filename-in-banner ] [ -l lines ] [ -r rows ] [ -c copies ] [ -t tab size ] [ -T ] [ -N ] [ -F form-number ] filename DESCRIPTION
With nprint, you can print files on print queues of a NetWare file server. There are a lot of options, so you should probably wrap some default configurations into some shell scripts. nprint looks up the file $HOME/.nwclient to find a file server, a user name and possibly a password. See nwclient(5) for more information. Please note that the access permissions of .nwclient MUST be 600, for security reasons. OPTIONS
filename filename is the name of the file you want to print. If file is '-', or no filename is given, standard input is used. -h -h is used to print out a short help text. -S server server is the name of the server you want to use. -U username username is the user name to use for the print request at the server. -P password password is the password to use for the print request at the server. If neither -n nor -P are given, and the user has no open connec- tion to the server, nprint prompts for a password. -n -n should be given if no password is required for the print request. -C By default, passwords are converted to uppercase before they are sent to the server, because most servers require this. You can turn off this conversion by -C. -q queuename queuename is the name of the print queue to use at the print server. At present, you must specify it in upper case characters. -d job-description job-description is the string that appears in pconsole when you list the jobs for the print queue. It will also appear in the "Descrip- tion" field on the banner page. -p pathname-in-banner pathname-in-banner is the string (up to 79 characters) you want to be printed in the "Directory" field on the banner page. -B username-in-banner username-in-banner is the string (up to 12 characters) you want to appear on the lower part of the banner page. It will also appear in the "User name" field. -s Supress printing of banner page -f filename-in-banner filename-in-banner is the string (up to 12 characters) you want to appear in large letters on the lower part of the banner page. Default: the name of the file that is printed, or 'stdin'. -l lines lines is the number of lines to put on one page. Default: 66. -r rows rows is the number of rows to put on one page. Default: 80. -c copies copies tells the print server to the specified number of copies. Default: 1. -t tabs tabs is the number of spaces to print for a Tab-Character. Default: 8. -T tells the print server to expand Tab-Character and use 8 spaces -N tells the print server not to use Form Feeds -F form-number form-number is the the number of the form to be put into the printer. If it's different from the one currently in the printer, your job is only printed if a printer operator has put in the correct form. NOTES
The '-B' option was formerly '-b'. But it conflicted with 'bindery only' login option. SEE ALSO
nwclient(5), slist(1), pqlist(1), ncpmount(8), ncpumount(8) CREDITS
nprint was written by Volker Lendecke (lendecke@math.uni-goettingen.de) nprint 12/27/1995 NPRINT(1)
All times are GMT -4. The time now is 03:24 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy