02-28-2008
I don't understand your question. But I wanted the input file to print out differently. Problem I was having was that the id are slit between blank lines and data I wanted to parse have different NF. I was trying awk and going the route of arrays with no luck, because while some records I want $2 on other records $2 might be a field I don't want.
Does this make sense??
And thank you for your time.
Last edited by timj123; 02-29-2008 at 09:13 AM..
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Greetings All!!
I have a very peculiar problem where I have to parse a big text file and extract useful data out of it with starting and ending block pattern matching.
e.g. I have a input file like this:
sample data
block1
sample data
start
useful data
end
sample data
block2
sample... (5 Replies)
Discussion started by: arminder
5 Replies
2. Shell Programming and Scripting
Hi,
I have file (FILE.tmp) having contents,
FILE.tmp
========
filename=menudata
records=0000000000037
ldbname=pinsys
timestamp=2005/05/14-18:32:33
I want to parse it bring a new file which will look like,
filename records ldbname timestamp... (2 Replies)
Discussion started by: Omkumar
2 Replies
3. Shell Programming and Scripting
Hi all,
I wud like to get ur assistance in retrieving lines containing l1.My excel dataset contains around 8000 lines.I converted it into a text tab delimiter file and got the lines containing l1,My output is a list of lines containing l1 saved in a outfile.Some of d lines from my outfile s... (5 Replies)
Discussion started by: sayee
5 Replies
4. Shell Programming and Scripting
Hi All
I have two files:
file 1
>AB_1
MLKKPIIIGVTGGSGGGKTSVSRAILDSFPNARIAMIQHDSYYKDQSHMSFEERVKTNYDHPLAFDTDFM
IQQLKELLAGRPVDIPIYDYKKHTRSNTTFRQDPQDVIIVEGILVLEDERLRDLMDIKLFVDTDDDIRII
RRIKRDMMERGRSLESIIDQYTSVVKPMYHQFIEPSKRYADIVIPEGVSNVVAIDVINSKIASILGEV
>AB_2... (5 Replies)
Discussion started by: Lucky Ali
5 Replies
5. Shell Programming and Scripting
Hi,
I have a folder that contains many (multiple) files
1.fasta
2.fasta
3.fasta
4.fasta
5.fasta
.
.
100's of files
Each such file have data in the following format
for example:
vi 1.fasta
>AB_1 gi|15835212|ref|NP_296971.1| preprotein translocase subunit SecE... (3 Replies)
Discussion started by: Lucky Ali
3 Replies
6. Shell Programming and Scripting
Hi All,
I need some help to effectively parse out a subset of results from a big results file.
Below is an example of the text file. Each block that I need to parse starts with "Output of GENE for sequence file 100.fasta" (next block starts with another number). I have given the portion of... (8 Replies)
Discussion started by: Lucky Ali
8 Replies
7. Shell Programming and Scripting
Hi,
I have 2 files
format of file 1 is:
a1
b2
a2
c2
d1
f3
format of file 2 is (tab delimited):
a1 1.2 0.5 0.06 0.7 0.9 1 0.023
a3 0.91 0.007 0.12 0.34 0.45 1 0.7
a2 1.05 2.3 0.25 1 0.9 0.3 0.091
b1 1 5.4 0.3 9.2 0.3 0.2 0.1
b2 3 5 7 0.9 1 9 0 1
b3 0.001 1 2.3 4.6 8.9 10 0 1 0... (10 Replies)
Discussion started by: Lucky Ali
10 Replies
8. Shell Programming and Scripting
I have 2 text files where I need to parse data from file 2 using the data from file 1. Below are my sample files
File 1 (tab delimited)
257 350
670 845
725 1025
767 820
...
....
....
file 2 (tab delimited)
220..450 TA AB650 ABCED
520..850 GA AB720 ABCDE
700..1100 TC AB820 ABCDE... (2 Replies)
Discussion started by: Lucky Ali
2 Replies
9. Shell Programming and Scripting
Im really beginner in this case, maybe someone can help me find the answer:
if my input file like this:
void main(int a, int b){
int x; double y;
printf("file");
}
and i want output like this:
int a
int b
int x
double y
A awk script that can parse only data tipe, im confused.
what... (2 Replies)
Discussion started by: radynaraya
2 Replies
10. Shell Programming and Scripting
Hey Guys,
I'm a novice at shell scripts and i need some help parsing file data.
Basically, I want to write a script that retrieves URLs.
Here is what I have so far.
#!/bin/bash
echo "Please enter start date (format: yyyy-mm-dd):\c"
read STARTDATE
echo "Please enter end date... (7 Replies)
Discussion started by: silverdust
7 Replies
LEARN ABOUT DEBIAN
net::dns::header
Net::DNS::Header(3pm) User Contributed Perl Documentation Net::DNS::Header(3pm)
NAME
Net::DNS::Header - DNS packet header class
SYNOPSIS
"use Net::DNS::Header;"
DESCRIPTION
A "Net::DNS::Header" object represents the header portion of a DNS packet.
METHODS
new
$header = Net::DNS::Header->new;
"new" creates a header object appropriate for making a DNS query.
parse
($header, $offset) = Net::DNS::Header->parse($data);
Parses the header record at the start of a DNS packet. The argument is a reference to the packet data.
Returns a Net::DNS::Header object and the offset of the next location in the packet.
Parsing is aborted if the header object cannot be created (e.g., corrupt or insufficient data).
print
$header->print;
Prints the header record on the standard output.
string
print $header->string;
Returns a string representation of the header object.
id
print "query id = ", $header->id, "
";
$header->id(1234);
Gets or sets the query identification number.
qr
print "query response flag = ", $header->qr, "
";
$header->qr(0);
Gets or sets the query response flag.
opcode
print "query opcode = ", $header->opcode, "
";
$header->opcode("UPDATE");
Gets or sets the query opcode (the purpose of the query).
aa
print "answer is ", $header->aa ? "" : "non-", "authoritative
";
$header->aa(0);
Gets or sets the authoritative answer flag.
tc
print "packet is ", $header->tc ? "" : "not ", "truncated
";
$header->tc(0);
Gets or sets the truncated packet flag.
rd
print "recursion was ", $header->rd ? "" : "not ", "desired
";
$header->rd(0);
Gets or sets the recursion desired flag.
cd
print "checking was ", $header->cd ? "not" : "", "desired
";
$header->cd(0);
Gets or sets the checking disabled flag.
ra
print "recursion is ", $header->ra ? "" : "not ", "available
";
$header->ra(0);
Gets or sets the recursion available flag.
ad
print "The result has ", $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.)
rcode
print "query response code = ", $header->rcode, "
";
$header->rcode("SERVFAIL");
Gets or sets the query response code (the status of the query).
qdcount, zocount
print "# of question records: ", $header->qdcount, "
";
$header->qdcount(2);
Gets or sets 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: ", $header->ancount, "
";
$header->ancount(5);
Gets or sets the number of records in the answer section of the packet. 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: ", $header->nscount, "
";
$header->nscount(2);
Gets or sets the number of records in the authority section of the packet. 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: ", $header->arcount, "
";
$header->arcount(3);
Gets or sets the number of records in the additional section of the packet. In dynamic update packets, this field is known as "adcount".
data
$hdata = $header->data;
Returns the header data in binary format, appropriate for use in a DNS query packet.
COPYRIGHT
Copyright (c) 1997-2002 Michael Fuhr.
Portions Copyright (c) 2002-2004 Chris Reinhardt.
Portions Copyright (c) 2007 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(1), Net::DNS, Net::DNS::Resolver, Net::DNS::Packet, Net::DNS::Update, Net::DNS::Question, Net::DNS::RR, RFC 1035 Section 4.1.1
perl v5.14.2 2009-12-30 Net::DNS::Header(3pm)