Sponsored Content
Top Forums Shell Programming and Scripting Count No of Records in File without counting Header and Trailer Records Post 302120666 by ghostdog74 on Thursday 7th of June 2007 12:15:59 PM
Old 06-07-2007
it depends on how your file format is, usually, header and trailer make up 2 records..
so you can just wc -l and then minus 2 .

Last edited by ghostdog74; 06-07-2007 at 01:22 PM..
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

grep all records in a file and get a word count -perl

Hi, I have a file .. file.txt .. i need to get a total record count in the files into a $variable.. im using perl script thanks (4 Replies)
Discussion started by: meghana
4 Replies

2. UNIX for Dummies Questions & Answers

Count records in a zip file

Hello, I searched the forums on the keywords in the title I used above, but I did not find the answer: Is it possible to count records in a .zip file on an AIX machine if i don't have pkunzip installed? From all the research I'm reading in google and the reading of pkunzip in Unix.com,... (3 Replies)
Discussion started by: tekster757
3 Replies

3. Shell Programming and Scripting

Merge text files while combining the multiple header/trailer records into one each.

Situation: Our system currently executes a job (COBOL Program) that generates an interface file to be sent to one of our vendors. Because this system processes information for over 100,000 employees/retirees (and growing), we'd like to multi-thread the job into processing-groups in order to... (4 Replies)
Discussion started by: oordonez
4 Replies

4. Shell Programming and Scripting

Help me in counting records from file

Hi, Please help me in counting the below records(1st field) from samplefile: Expected output: Count Descr ------------------------------------------- 7 Mean manager 14 ... (7 Replies)
Discussion started by: prashant43
7 Replies

5. Shell Programming and Scripting

Header as is.. trailer count

i have .DAT file FILE1.DAT 1200910270040625 2123456789 J123456 ABC 2123456789 K123456 ABC 2222222222 L123456 DEF 2333333333 M12345 GHI 30000004 My outfile FILE2.TXT should have like this, I need the header value as ie (1200910270040625 ) body rows remove the duplicate rows and the... (2 Replies)
Discussion started by: kshuser
2 Replies

6. Shell Programming and Scripting

improve performance - replace $\| with $#@ and remove header and trailer records

Hi All, In my file i need to remove header and trailer records which comes in 1st line and last line respectively. After that i need to replace '$\|' with '$#@'. I am using sed command for this and its taking lot of time. Is there any other command which can be used to improve performance? ... (1 Reply)
Discussion started by: HemaV
1 Replies

7. UNIX for Dummies Questions & Answers

Grep specific records from a file of records that are separated by an empty line

Hi everyone. I am a newbie to Linux stuff. I have this kind of problem which couldn't solve alone. I have a text file with records separated by empty lines like this: ID: 20 Name: X Age: 19 ID: 21 Name: Z ID: 22 Email: xxx@yahoo.com Name: Y Age: 19 I want to grep records that... (4 Replies)
Discussion started by: Atrisa
4 Replies

8. Shell Programming and Scripting

Adding Header and Trailer records to a appended file

How can we a shell script and pass date parameters .I have 3 files comming from Datastage with |" delimited I need append 3 files as above: File1: P0000|"47416954|"AU|"000|"INS|"0000|"|"20060601|"99991231|"|"|"|"|"01 File 2:... (2 Replies)
Discussion started by: e1994264
2 Replies

9. Shell Programming and Scripting

How to count dup records in file?

Hi Gurus, I need to count the duplicate records in file file abc abc def ghi ghi jkl I want to get below result: abc ,2 abc, 2 def ,1 ghi ,2 ghi, 2 jkl ,1 or abc ,2 def ,1 (3 Replies)
Discussion started by: ken6503
3 Replies

10. Shell Programming and Scripting

Separate records of a file on 2 types of records

Hi I am new to shell programming in unix Please if I can provide help. I have a file structure of a header record and "N" detail records. The header record will be the total number of detail records I need to split the file in 2: One for the header Another for all detail records Could... (1 Reply)
Discussion started by: jamcogar
1 Replies
HTPROXY(1)							   User Commands							HTPROXY(1)

NAME
htproxy - record a HTTP session SYNOPSIS
htproxy [OPTIONS] DESCRIPTION
htproxy do record a HTTP session as a httest script OPTIONS
-v --version Print version number and exit -h --help Display usage information (this message) -p --port Port -d --dest Destination file, default file is "file" -u --url-filter URL filter regex default is none (blacklist) -l --log-level Log level 0-4 -H --host-var Variable name for host -P --port-var Variable name for port -U --root-var Web application root variable name -A --host-header-var Variable name for host header value -t --socket-tmo Socket timeout [ms], default 30000 ms -i --header-file File with header text -e --trailer-file File with trailer text -c --cookie-prefix Cookie variable prefix, default is COOKIE_ -C --config Configuration file Example: htproxy -p 8888 -d init -H HOST -P PORT -u "(.*.png;.*$)|(.*.css;.*$)|(.*.ico;.*$)|(.*.js;.*$)" AUTHOR
Written by Christian Liesch COPYRIGHT
Copyright (C) 2006 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICU- LAR PURPOSE. htproxy 2.2.6 June 2012 HTPROXY(1)
All times are GMT -4. The time now is 04:07 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy