Sponsored Content
Full Discussion: Counting lines and files
Top Forums UNIX for Dummies Questions & Answers Counting lines and files Post 44838 by davidg on Thursday 11th of December 2003 09:17:32 AM
Old 12-11-2003
Hi,

Looking at your script we can find out you use tar. Unfortunetly I do not know the device /dev/rpt However, I think you can do a "mt rewind" and then a "tar tvf /dev/rpt | wc -l"

If you do not trust the output you could also do a "tar tvf /dev/rpt" without the wc -l. Just as a test.

Regs David
 

10 More Discussions You Might Find Interesting

1. Linux

counting the number of lines

Hello, I have afile which begins with a few urls on multiple lines and then there is listing of some information on separate lines. The listing begins with the word Name on a given line followed by teh actual list. I want to count the number of lines in this file after the line having... (6 Replies)
Discussion started by: nayeemmz
6 Replies

2. Shell Programming and Scripting

Merging files with AWK filtering and counting lines

Hi there, I have a couple of files I need to merge. I can do a simple merge by concatenating them into one larger file. But then I need to filter the file to get a desired result. The output looks like this: TRNH 0000000010941 ORDH OADR OADR ORDL ENDT 1116399 000000003... (2 Replies)
Discussion started by: Meert
2 Replies

3. Shell Programming and Scripting

counting the lines of diff files in loop

i have two file. i want to count the lines of each file one by one in loop and compare it. can any one pls help me on this? (1 Reply)
Discussion started by: Aditya.Gurgaon
1 Replies

4. Shell Programming and Scripting

Counting lines in multiple files

Hi, I have couple of .txt files (say 50 files) in a folder. For each file: I need to get the number of lines in each file and then that count -1 (I wanted to exclude the header. Then sum the counts of all files and output the total sum. Is there an efficient way to do this using shell... (7 Replies)
Discussion started by: Lucky Ali
7 Replies

5. Shell Programming and Scripting

Counting lines between two patterns

Hi Guys, I have a file as follows: wwe khfgv jfo wwe jhgfd wwe wwe hoaha hao lkahe wwe (13 Replies)
Discussion started by: npatwardhan
13 Replies

6. Shell Programming and Scripting

Counting similar lines

Hi, I have a little problem with counting lines. I know similar topics from this forum, but they don't resolve my problem. I have file with lines like this: 2009-05-25 16:55:32,143 some text some regular expressions ect. 2009-05-25 16:55:32,144 some text. 2009-05-28 18:15:12,148 some... (4 Replies)
Discussion started by: marcinnnn
4 Replies

7. Shell Programming and Scripting

Counting lines for each application

Hi All, I have a output that suppose to be like this (see below please) App : Line counts === ================== AAA: 100 BBB: 201 CCC: 137 DDD: 32 EEE: 55 for i in `ps -ef | grep App`; do print $i; done This only shows App : === (12 Replies)
Discussion started by: Beginer0705
12 Replies

8. UNIX for Advanced & Expert Users

Delete # of Lines after counting

I'm trying to write a script to clean up log file automatically when it reaches 1000 lines. I can't get this to work..can some help me please :) Server: SunOS 5.8 Generic_117350-53 sun4u sparc SUNW,Netra-T12 #!/bin/ksh #file reference file=`echo "$HOME/support/moe/b.tc"` #linecount... (7 Replies)
Discussion started by: moe458
7 Replies

9. Shell Programming and Scripting

sed counting lines

Hi, I'm using the command: sed -n '$=' $1 on a sh script on AIX. This script is used to count the number of lines of files. If the file has no lines at all the command doesn't return nothing. I need the command to return 0 when the file has no lines at all. How can I achieve this? Best... (5 Replies)
Discussion started by: jppedroso
5 Replies

10. UNIX for Dummies Questions & Answers

Counting # of lines

Counting number of lines: sp I am trying to figure out a script to count the number of text files in cywig and have it give me a number (as the answer) any help would be appreciated. I am new here, so be gentle :D (3 Replies)
Discussion started by: unicksjp
3 Replies
FDWRITE(1)						    BSD General Commands Manual 						FDWRITE(1)

NAME
fdwrite -- format and write floppy disks SYNOPSIS
fdwrite [-v] [-y] [-f inputfile] [-d device] DESCRIPTION
The fdwrite utility formats and writes one and more floppy disks. Any floppy disk device capable of formatting can be used. The fdwrite utility will ask the user (on /dev/tty) to insert a new floppy and press return. The device will then be opened, and queried for its parameters, then each track will be formatted, written with data from the inputfile, read back and compared. When the floppy disk is filled, the process is repeated, with the next disk. This continues until the program is interrupted or EOF is encountered on the inputfile. The options are as follows: -v Toggle verbosity on stdout. Default is ``on''. After device is opened first time the format will be printed. During operation progress will be reported with the number of tracks remaining on the current floppy disk, and the letters I, Z, F, W, R and C, which indicates completion of Input, Zero-fill, Format Write, Read and Compare of current track respec- tively. -y Do not ask for presence of a floppy disk in the drive. This non-interactive flag is useful for shell scripts. -f inputfile Input file to read. If none is given, stdin is assumed. -d device The name of the floppy device to write to. Default is /dev/fd0. The fdwrite utility actually closes the device while it waits for the user to press return, it is thus quite possible to use the drive for other purposes at this time and later resume writing with the next floppy. The parameters returned from device are used for formatting. If custom formatting is needed, please use fdformat(1) instead. EXAMPLES
The fdwrite utility was planned as a tool to make life easier when writing a set of floppies, one such use could be to write a tar-archive: tar cf -. | gzip -9 | fdwrite -d /dev/fd0.1720 -v The main difference from using tar(1)'s multivolume facility is of course the formatting of the floppies, which here is done on the fly, thus reducing the amount of work for the floppy-jockey. SEE ALSO
fdformat(1) HISTORY
The fdwrite utility was written while waiting for ``make world'' to complete. Some of the code was taken from fdformat(1). AUTHORS
The program has been contributed by Poul-Henning Kamp <phk@FreeBSD.org>. BUGS
Diagnostics are less than complete at present. If a floppy is sick, and the inputfile is seekable, it should ask the user to frisbee the disk, insert another, and rewind to the right spot and continue. This concept could be extended to cover non-seekable input also by employing a temporary file. An option (defaulting to zero) should allow the user to ask for retries in case of failure. At present a suitable tool for reading back a multivolume set of floppies is missing. Programs like tar(1) for instance, will do the job, if the data has not been compressed. One can always trust dd(1) to help out in this situation of course. BSD
September 16, 1993 BSD
All times are GMT -4. The time now is 04:01 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy