Sponsored Content
Top Forums Shell Programming and Scripting Printing Number of Fields with the line number Post 302591910 by bartus11 on Saturday 21st of January 2012 01:56:27 PM
Old 01-21-2012
Code:
awk -F '|' '{print NR,NF}'

This User Gave Thanks to bartus11 For This Post:
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

printing a line number using awk

Hi Chaps, I'm trying to print the line number of a comma delimited file where the second field in the line is blank using AWK. Here is the code I have so far where am I going wrong. It is the last column in the file. nawk -v x==0 'BEGIN {FS=",";OFS=","} x++ if ($2 == " ") print $x' bob.tst ... (3 Replies)
Discussion started by: rjsha1
3 Replies

2. Shell Programming and Scripting

Adding a columnfrom a specifit line number to a specific line number

Hi, I have a huge file & I want to add a specific text in column. But I want to add this text from a specific line number to a specific line number & another text in to another range of line numbers. To be more specific: lets say my file has 1000 lines & 4 Columns. I want to add text "Hello"... (2 Replies)
Discussion started by: Ezy
2 Replies

3. Shell Programming and Scripting

printing line number

hi, i have a file, i need to search for a string , if the line contains i need to print that line number and line , please help thanks in advance Satya (5 Replies)
Discussion started by: Satyak
5 Replies

4. Shell Programming and Scripting

regarding about printing line number

Hello, I am testing some data to get line number at cursor position 9 and found some problem, the code is below.Assume we got 3 attribute. At second attribute, there are some data(eg.A41/A6) missing like at the fourth and six line 11006 A41 1888 11006 ... (7 Replies)
Discussion started by: davidkhan
7 Replies

5. UNIX for Dummies Questions & Answers

How to read contents of a file from a given line number upto line number again specified by user

Hello Everyone. I am trying to display contains of a file from a specific line to a specific line(let say, from line number 3 to line number 5). For this I got the shell script as shown below: if ; then if ; then tail +$1 $3 | head -n $2 else ... (5 Replies)
Discussion started by: grc
5 Replies

6. Shell Programming and Scripting

Printing the line number in bash script

Hi, I would like to know how do I print the line # in a script. My requirement is, I have a script which is about ~5000 lines long. If there are any errors happen I just exit. And I would like to add the line # of the script where the error happened. Thanks, (6 Replies)
Discussion started by: suryaemlinux
6 Replies

7. Shell Programming and Scripting

print the number of fields in each line

I am looking for equivalent of following awk command in perl # awk '{ print NF ":" $0 } ' junk1 8:VAH NIC_TYPE CONFIG SIZE_GB PILO KOM BHA_GRP DESCR 8:2 NIC6 cont 34 y n shal_orgrp /shal 8:4 NIC5 signa 52 n y shal_orgrp... (3 Replies)
Discussion started by: dynamax
3 Replies

8. Shell Programming and Scripting

Printing the line number of first column found

Hello, I have a question on how to find the line number of the first column that contains specific data. I know how to print all the line numbers of those columns, but haven't been able to figure out how to print only the first one that is found. For example, if my data has four columns: 115... (3 Replies)
Discussion started by: user553
3 Replies

9. Shell Programming and Scripting

awk to find number in a field then print the line and the number

Hi I want to use awk to match where field 3 contains a number within string - then print the line and just the number as a new field. The source file is pipe delimited and looks something like 1|net|ABC Letr1|1530||| 1|net|EXP_1040 ABC|1121||| 1|net|EXP_TG1224|1122||| 1|net|R_North|1123|||... (5 Replies)
Discussion started by: Mudshark
5 Replies

10. Shell Programming and Scripting

Print line if values in fields matches number and text

datafile: 2017-03-24 10:26:22.098566|5|'No Route for Sndr:RETEK RMS 00040 /ZZ Appl:PF Func:PD Txn:832 Group Cntr:None ISA CntlNr:None Ver:003050 '|'2'|'PFI'|'-'|'EAI_ED_DeleteAll'|'EAI_ED'|NULL|NULL|NULL|139050594|ActivityLog| 2017-03-27 02:50:02.028706|5|'No Route for... (7 Replies)
Discussion started by: SkySmart
7 Replies
READMULT(1)							     readmult							       READMULT(1)

NAME
readmult - a multitrack wrapper for cdda2wav SYNOPSIS
readmult <track a> <title a> <track b> <title b> ... DESCRIPTION
readmult allows simultaneous extraction and naming of multiple tracks with cdda2wav SEE ALSO
cdda2wav(1) AUTHOR
cdda2was was written by Joerg Schilling <js@cs.tu-berlin.de> and others. This describes the program as shipped with cdrkit, see This manpage describes the program implementation of readmult as shipped by the cdrkit distribution. See http://alioth.debian.org/projects/debburn/ for details. It is a spinoff from the original program distributed by the cdrtools project. However, the cdrtools developers are not involved in the development of this spinoff and therefore shall not be made responsible for any problem caused by it. Do not try to get support for this program by contacting the original authors. If you have support questions, send them to debburn-devel@lists.alioth.debian.org If you have definitely found a bug, send a mail to this list or to submit@bugs.debian.org writing at least a short description into the Subject and "Package: cdrkit" into the first line of the mail body. This manual page was written by Oleksandr Moskalenko <malex@tagancha.org>, for the Debian GNU/Linux system. It may be used by other dis- tributions without contacting the author. Any mistakes or omissions in the manual page are my fault; inquiries about or corrections to this manual page should be directed to me (and not to the primary author). Tue Feb 15 12:34:06 MST 2005 READMULT(1)
All times are GMT -4. The time now is 02:25 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy