Sponsored Content
Full Discussion: Check length of record
Top Forums Shell Programming and Scripting Check length of record Post 302341785 by Scott on Thursday 6th of August 2009 02:55:29 PM
Old 08-06-2009
Hi.

Code:
awk 'length != 58' file

Yes, "file" is the input filename.

This will print all records which don't have 58 characters (to answer your question specifically, it will print to standard output).
 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

fixed record length

hello! I have a file with fixed record length... format: 123445asdfg 4343777 sfgg I wanna convert it to 123445,asdfg ,4343,777 ,sfgg is there any way to do it? sed/grep/awk?? at the moment I use sed -e 's_ \(\)_,\1_g' but it works only if there are spaces between... (16 Replies)
Discussion started by: george_
16 Replies

2. UNIX for Dummies Questions & Answers

What the command to find out the record length of a fixed length file?

I want to find out the record length of a fixed length file? I forgot the command. Any body know? (9 Replies)
Discussion started by: tranq01
9 Replies

3. Shell Programming and Scripting

Make variable length record a fixed length

Very, very new to unix scripting and have a unique situation. I have a file of records that contain 3 records types: (H)eader Records (D)etail Records (T)railer Records The Detail records are 82 bytes in length which is perfect. The Header and Trailer records sometimes are 82 bytes in... (3 Replies)
Discussion started by: jclanc8
3 Replies

4. Shell Programming and Scripting

Viewing a record of particular length

I have records with different lengths say 386, 387 and 388. Do i have any command to view all the records of the length 386 ? Please do advise. Thanks (2 Replies)
Discussion started by: bobby1015
2 Replies

5. Shell Programming and Scripting

Record length

Hi, The record length may be differ in afile. I want to display the records if the record length is not equal to 50 using sed/awk command. Thanks in Advance (6 Replies)
Discussion started by: NareshN
6 Replies

6. Shell Programming and Scripting

Check for length which exceeds specified length in a line

Hi, I have a issue, I need to loop through a comma delimited file and check for the length which exceeds specified length , if Yes truncate the string. But my problem is , I do not have to check for all the fields and the field lenght is not same for all the fields. For ex: Say my line... (9 Replies)
Discussion started by: rashmisb
9 Replies

7. Shell Programming and Scripting

Record length check fails due to '\' character

When I check the length for the records in the file, it does not give me the correct value. I used wc -l command. Example records: abcdefghij abcd\efghij abcdefghi Expected output is: 10 11 9 But the output returned is 10 10 9 Please help me on this issue. (10 Replies)
Discussion started by: Amrutha24
10 Replies

8. Shell Programming and Scripting

Verifying Record Length

Hi all, We are going through a total migration from AIX-based server framework to Linux-based servers. When I am testing *.sh and *.awk in a lower environments, it abends at the same step everytime in verifying the record length of the first row of the source file. I know this source file... (11 Replies)
Discussion started by: SoloXX
11 Replies

9. Shell Programming and Scripting

Convert variable length record to fixed length

Hi Team, I have an issue to split the file which is having special chracter(German Char) using awk command. I have a different length records in a file. I am separating the files based on the length using awk command. The command is working fine if the record is not having any... (7 Replies)
Discussion started by: Anthuvan
7 Replies
Net::DNS::Header(3)					User Contributed Perl Documentation				       Net::DNS::Header(3)

NAME
Net::DNS::Header - DNS packet header SYNOPSIS
use Net::DNS; $packet = new Net::DNS::Packet; $header = $packet->header; DESCRIPTION
"Net::DNS::Header" represents the header portion of a DNS packet. METHODS
$packet->header $packet = new Net::DNS::Packet; $header = $packet->header; Net::DNS::Header objects emanate from the Net::DNS::Packet header() method, and contain an opaque reference to the parent Packet object. Header objects may be assigned to suitably scoped lexical variables. They should never be stored in global variables or persistent data structures. string print $packet->header->string; Returns a string representation of the packet header. string $packet->header->print; Prints the string representation of the packet header. id print "query id = ", $packet->header->id, " "; $packet->header->id(1234); Gets or sets the query identification number. A random value is assigned if the argument value is undefined. opcode print "query opcode = ", $packet->header->opcode, " "; $packet->header->opcode("UPDATE"); Gets or sets the query opcode (the purpose of the query). rcode print "query response code = ", $packet->header->rcode, " "; $packet->header->rcode("SERVFAIL"); Gets or sets the query response code (the status of the query). qr print "query response flag = ", $packet->header->qr, " "; $packet->header->qr(0); Gets or sets the query response flag. aa print "answer is ", $packet->header->aa ? "" : "non-", "authoritative "; $packet->header->aa(0); Gets or sets the authoritative answer flag. tc print "packet is ", $packet->header->tc ? "" : "not ", "truncated "; $packet->header->tc(0); Gets or sets the truncated packet flag. rd print "recursion was ", $packet->header->rd ? "" : "not ", "desired "; $packet->header->rd(0); Gets or sets the recursion desired flag. ra print "recursion is ", $packet->header->ra ? "" : "not ", "available "; $packet->header->ra(0); Gets or sets the recursion available flag. z Unassigned bit, should always be zero. ad print "The result has ", $packet->header->ad ? "" : "not", "been verified "; Relevant in DNSSEC context. (The AD bit is only set on answers where signatures have been cryptographically verified or the server is authoritative for the data and is allowed to set the bit by policy.) cd print "checking was ", $packet->header->cd ? "not" : "", "desired "; $packet->header->cd(0); Gets or sets the checking disabled flag. qdcount, zocount print "# of question records: ", $packet->header->qdcount, " "; Returns the number of records in the question section of the packet. In dynamic update packets, this field is known as "zocount" and refers to the number of RRs in the zone section. ancount, prcount print "# of answer records: ", $packet->header->ancount, " "; Returns the number of records in the answer section of the packet which may, in the case of corrupt packets, differ from the actual number of records. In dynamic update packets, this field is known as "prcount" and refers to the number of RRs in the prerequisite section. nscount, upcount print "# of authority records: ", $packet->header->nscount, " "; Returns the number of records in the authority section of the packet which may, in the case of corrupt packets, differ from the actual number of records. In dynamic update packets, this field is known as "upcount" and refers to the number of RRs in the update section. arcount, adcount print "# of additional records: ", $packet->header->arcount, " "; Returns the number of records in the additional section of the packet which may, in the case of corrupt packets, differ from the actual number of records. In dynamic update packets, this field is known as "adcount". EDNS Protocol Extensions do print "DNSSEC_OK flag was ", $packet->header->do ? "not" : "", "set "; $packet->header->do(1); Gets or sets the EDNS DNSSEC OK flag. Extended rcode EDNS extended rcodes are handled transparently by $packet->header->rcode(). UDP packet size $udp_max = $packet->header->size; $udp_max = $packet->edns->size; EDNS offers a mechanism to advertise the maximum UDP packet size which can be assembled by the local network stack. UDP size advertisement can be viewed as either a header extension or an EDNS feature. Endless debate is avoided by supporting both views. edns $header = $packet->header; $version = $header->edns->version; @options = $header->edns->options; $option = $header->edns->option(n); $udp_max = $packet->edns->size; Auxiliary function which provides access to the EDNS protocol extension OPT RR. COPYRIGHT
Copyright (c)1997-2002 Michael Fuhr. Portions Copyright (c)2002-2004 Chris Reinhardt. Portions Copyright (c)2012 Dick Franks. All rights reserved. This program is free software; you may redistribute it and/or modify it under the same terms as Perl itself. SEE ALSO
perl, Net::DNS, Net::DNS::Packet, Net::DNS::RR::OPT RFC 1035 Section 4.1.1 perl v5.18.2 2014-01-16 Net::DNS::Header(3)
All times are GMT -4. The time now is 10:44 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy