Hi All,
Is there any command which can convert binary decimal coded values to ascii values...
i have bcd values like below
оооооооооооо0о-- -v -
Pls suggest a way to convert this.
Thanks,
Deepti.Gaur (3 Replies)
Hi guys I'm trying to print average of 2 columns.
awk '{print ($1+$2)/2}' file.txt
Its printing average but not giving decimal values
its giving 3.05521e+08 instead of 305521....
I tried %f to print float values but not quiet connected
Could you help plz:confused: (5 Replies)
Hi,
I have a small requirement where i need to sum up a column in a text file.
Input file
66ab 000000 534385 -00000106350.00
66cd 000000 534485 -00013364511.00
66ad 000000 534485 -00000426548.00
672a 000000 534485 000000650339.82... (5 Replies)
Hi All,
In my script I've written like this-
c=$( expr 100 / 3);echo $c
The output coming is 33. but I want to see 33.33, decimal values too. How to get that?
Thanks,
Naresh (3 Replies)
Hi Friends,
This is my last post for today.
My input file is
chr1 100 200
chr1 123 300
chr1 300 400
chr1 420 520
chr10 132344343 132348674
When I try using this command
awk '{v=($3+$2)/2; print $0"\t"v}' 1
This is my output
chr1 100 200 150
chr1 123 300 211.5 (2 Replies)
I have 2 files say tp1.txt and tp2.txt having following data
cat tp1.txt
abc,2.20,IN20
acb,3.15,DN10
bca,3,RD10
cat tp2.txt
alv,1.00,IN20
aaa,4.05,DD10
abb,5.50,RD12
i want to compare the values on 2nd field of both the file, if value of first tp1.txt is greater than value... (3 Replies)
Discussion started by: ranabhavish
3 Replies
8. Post Here to Contact Site Administrators and Moderators
HI Everyone,
I have below source file
AAA|NAME1|ADDRESS1|300.20
BBB|NAME2|ADDRESS2|400.31
CCC|NAME3|ADDRESS3|300.34
I have requirement where I need to sum up fourth field in above fixed width pipe delimited flat file. When I use below code, it gives me value 1001.00
But I am expecting... (1 Reply)
I used the below script to Sum up a field in a file based on some unique values. But the problem is when it is summing up the units, it is truncating to 2 decimals and not 6 decimals as in the input file (Input file has the units with up to 6 Decimals – Sample data below, when the units in the 2... (4 Replies)
Discussion started by: brlsubbu
4 Replies
LEARN ABOUT DEBIAN
io::async::protocol::linestream
IO::Async::Protocol::LineStream(3pm) User Contributed Perl Documentation IO::Async::Protocol::LineStream(3pm)NAME
"IO::Async::Protocol::LineStream" - stream-based protocols using lines of text
SYNOPSIS
Most likely this class will be subclassed to implement a particular network protocol.
package Net::Async::HelloWorld;
use strict;
use warnings;
use base qw( IO::Async::Protocol::LineStream );
sub on_read_line
{
my $self = shift;
my ( $line ) = @_;
if( $line =~ m/^HELLO (.*)/ ) {
my $name = $1;
$self->invoke_event( on_hello => $name );
}
}
sub send_hello
{
my $self = shift;
my ( $name ) = @_;
$self->write_line( "HELLO $name" );
}
This small example elides such details as error handling, which a real protocol implementation would be likely to contain.
DESCRIPTION EVENTS
The following events are invoked, either using subclass methods or CODE references in parameters:
on_read_line $line
Invoked when a new complete line of input is received.
PARAMETERS
The following named parameters may be passed to "new" or "configure":
on_read_line => CODE
CODE reference for the "on_read_line" event.
METHODS
$lineprotocol->write_line( $text )
Writes a line of text to the transport stream. The text will have the end-of-line marker appended to it; $text should not end with it.
AUTHOR
Paul Evans <leonerd@leonerd.org.uk>
perl v5.14.2 2012-10-24 IO::Async::Protocol::LineStream(3pm)