I want to split/parse certain bits of the hex data into another field.
Example:
Input data is
Word1: 4f72abfd
Output:
Parse bits (5 to 0) into field word1data1=0x00cd=205 decimal
Parse bits (7 to 6) into field word1data2=0x000c=12 decimal
etc.
Word2: efff3d02
Parse bits (13 to 3) into field word2data1=0x0f40=3904 decimal
Parse bits (16 to 14) into field word2data2=0x0004=4 decimal
etc.
The bits that are parsed from each input word is different for all 8 input hex words.
I have the following INPUT hex file (input.txt):
# line is a comment
... and so on and so forth
I would like the OUTPUT to look like this (output.txt):
Am not able to display the corresponding character for the hex value using the format specifier into a file
Could you please help me with that
>cat other
a|\xc2\xbo
>cat write.pl
#! /opt/third-party/bin/perl
open(FILE2, "< other") || die "Unable to open file other\n";
while (... (7 Replies)
Folks,
I have a bit of an issue trying to obtain some data from a csv file using PERL. I can sort the file and remove any duplicates leaving only 4 or 5 rows containing data. My problem is that the data contained in the original file contains a lot more columns and when I try ro run this script... (13 Replies)
#!/bin/bash
i=0
cat 1.csv | while read fileline
do
echo "$fileline"
IFS="#" flds=( $fileline )
nrofflds=${#flds}
echo "noof fields$nrofflds"
fld=0
while
do
echo "noof counter$fld"
echo "$nrofflds"
#fld1="${flds}" trying to store the content of line to fields but i... (4 Replies)
I'm trying to find all modules that contain line feed characters. It shows up at ^M (Hex 0D0A). Does anyone know how to do a search for hex fields?
I tried doing "egrep ^M *.cbl", but that doesn't work.
Thanks! (3 Replies)
Hi,
I have the file like this:
#Contents of file 1 are:
Dec 10 12:33:44 User1 Interface: Probe
Dec 10 12:33:47 uSER1 SOME DATA
Dec 10 12:33:47 user1 Interface: MSGETYPE
Dec 10 12:34:48 user1 ID: 10.
Dec 10 12:33:55 user1 Interface: MSGTYPE
Dec 10 12:33:55 user1 Id: 9
... (1 Reply)
I have 32 bit value in hex that I want to separate into fields and then convert the fields into decimal values.
Input file has 2 words of 32 bit hex values:
000001ac
ca85210e
Output both words separated into individual bit fields:
ca85210e: f1(31:9), f2(8:0)
f7c392ac: f1(31:14),... (2 Replies)
I have an input file attached that I am trying to parse in tab-delimanted format:
The chromosomal variant column contains all the information:
parse rules:
1. 4 zeros after the NC_ and the digits before the .
2. digits after the g. repeated twice separated by a tab
3. letter before the >
4.... (10 Replies)
The below awk parser works for most data inputs, but I am having trouble with the last one. The problem is in the below rules steps 1 and 2 come from $2 (NC_000013.10:g.20763686_20763687delinsA) and steps 3 and 4 come from $1 (NM_004004.5:c.34_35delGGinsT).
Parse Rules:
The header is... (0 Replies)
Hello,
I am working parsing a large input file1(field CFA)
I have to compare the the file1 field(CFA byte 88-96) with the content of the file2(It contains only one field) and and insert rows equal
in another file.
Here is my code and sample input file:
... (7 Replies)
I have a file of ~500,000 entries in the following:
file.txt
chr1 11868 12227 ENSG00000223972.5 . + HAVANA exon . gene_id "ENSG00000223972.5"; transcript_id "ENST00000456328.2"; gene_type "transcribed_unprocessed_pseudogene"; gene_status "KNOWN"; gene_name "DDX11L1"; transcript_type... (17 Replies)
Discussion started by: cmccabe
17 Replies
LEARN ABOUT DEBIAN
postfix::parse::mailq
Postfix::Parse::Mailq(3pm) User Contributed Perl Documentation Postfix::Parse::Mailq(3pm)NAME
Postfix::Parse::Mailq - parse the output of the postfix mailq command
VERSION
version 1.001
SYNOPSIS
use Postfix::Parse::Mailq;
my $mailq_output = `mailq`;
my $entries = Postfix::Parse::Mailq->read_string($mailq_output);
my $bytes = 0;
for my $entry (@$entries) {
next unless grep { /@aol.com$/ } @{ $entry->{remaining_rcpts} };
$bytes += $entry->{size};
}
print "$bytes bytes remain to send to AOL destinations
";
WARNING
This code is really rough and the interface will change. Entries will be objects. There will be some more methods. Still, the basics are
likely to keep working, or keep pretty close to what you see here now.
METHODS
read_file
read_handle
read_string
my $entries = Postfix::Parse::Mailq->read_string($string, \%arg);
This methods read the output of postfix's mailq from a file (by name), a filehandle, or a string, respectively. They return an arrayref of
hashrefs, each hashref representing one entry in the queue as reported by mailq.
Valid arguments are:
spool - a hashref of { queue_id -> spool_name } pairs
if given, this will be used to attempt to indicate in which
spool messages currently are; it is not entirely reliable (race!)
parse_block
my $entry = Mailq->parse_block(@lines);
Given all the lines in a single entry's block of lines in mailq output, this returns data about the entry.
AUTHOR
Ricardo SIGNES <rjbs@cpan.org>
COPYRIGHT AND LICENSE
This software is copyright (c) 2008 by Ricardo SIGNES.
This is free software; you can redistribute it and/or modify it under the same terms as perl itself.
perl v5.10.1 2008-10-23 Postfix::Parse::Mailq(3pm)