Hi,
This is a vcd file.A vcd file may have 'n' modules.
1) I need to capture the data in bold,i.e. the module names (shown in bold)
2) Also i need to capture the data inside each individual module,say for tst_bench_top ,i need to capture data from line 4 to line 20 ...
I just want one generalized Perl script that says read the data after the $end of "$scope module" statement to the data before next "$scope module" statement....
In the ex show below i wanna read from line 4 to line 20,but a module may have even more/less than 20 lines.Hence i want a generalized script.
I have a file with some values in a tab delimted format
Eg:
'test' contains:
a<tab>b<tab>c<tab>Trk_12345678
now i need to capture this value 'Trk_12345678' into a variable say 'x' and append that value of 12345678 to 12345679 and store is back to a new 'test1' file as :
'test1'... (11 Replies)
Hi guys,
I need a way to capture the host on the next-to-last hop in a traceroute output.
The last output is the destination but I need to capture the router just before the last hop.
I can do this in perl but I'm not so sure about Shell...
I'm on AIX 5.3 using ksh
any ideas?
... (3 Replies)
Hi everyone!
Can any one help me out regarding capturing relevant data from a file.
For e.g, if i want to capture the comment written after "Prompt:" for a particular date, like for this case what would be the command to capture the tag written after "Prompt:" for Date: 2009-03-20.
A... (7 Replies)
i have file in the following format
*RECORD*
*FIELD NO*
123456
*FIELD TX*
this is a sample entry
*FIELD SA*
See Also
*FIELD RF*
References
*FIELD CS*
Clinical Symptoms
*FIELD AV*
Allelic Variants
*FIELD EH*
Edit History
*RECORD*
*FIELD NO*
123456 (1 Reply)
Hi,
I would like to seek for methods to do selective extraction of line froma file. The scenario as follows:
I have a file with content:
message a
received on 11:10:00
file size: 10 bytes
send by abc
message b
received on 11:20:00
file size: 10 bytes
send by abc (3 Replies)
Hii, Friends,
I want your help in one of my problem.
My problem is as follows.
I have a flat file as follows (Just a sample)
MHT011
01(DOT)8750707asdfas8609
03(DOT)ASD3453ASD
09(DOT)876JHT87
11(DOT)sfd324ert
TTT077
01(MOB)876786klj897
06(MOB)876JHT87
07(MOB)sfd324ert... (4 Replies)
Helo Folks :)
i had read an answer in this thread unixcom/programming/117551-calculate-ip-header-checksum-manually.html
i need to know what the software name that was used to capturing packet data in a network, just like the packet's capture output that showed up in the thread.
Thank you :)... (5 Replies)
I have installed nethogs to see which process is sending load on the network. i would like to know how can i capture its data in a log file. Or is there is a unix command like script or tee which can help me to capture the data using cronjob (0 Replies)
Hi folks,
I am working on assignment that captures all the records(2 columns one column contains names and other contain date of birth) from excel sheet stored in a directory and checks for current date and month.
If it matches current date and month then the matched records are printed as... (1 Reply)
I have the following file which at times can be quite large so can be difficult to read, I need a script that just extracts particular delimited data and outputs to alternate file
$cat fix1.log
FIX4.4|0=12|55=LIT.L|48=123456|32=5|52=20111107-10:52:22.128|38=100|10=200|
... (6 Replies)
Discussion started by: Buddyluv
6 Replies
LEARN ABOUT DEBIAN
io::capture::stdout
IO::Capture::Stdout(3pm) User Contributed Perl Documentation IO::Capture::Stdout(3pm)NAME
IO::Capture::Stdout - Capture any output sent to STDOUT
SYNOPSIS
# Generic example (Just to give the overall view)
use IO::Capture::Stdout;
$capture = IO::Capture::Stdout->new();
$capture->start(); # STDOUT Output captured
print STDOUT "Test Line One
";
print STDOUT "Test Line Two
";
print STDOUT "Test Line Three
";
$capture->stop(); # STDOUT output sent to wherever it was before 'start'
# In 'scalar context' returns next line
$line = $capture->read;
print "$line"; # prints "Test Line One"
$line = $capture->read;
print "$line"; # prints "Test Line Two"
# move line pointer to line 1
$capture->line_pointer(1);
$line = $capture->read;
print "$line"; # prints "Test Line One"
# Find out current line number
$current_line_position = $capture->line_pointer;
# In 'List Context' return an array(list)
@all_lines = $capture->read;
# More useful example 1 - "Using in module tests"
# Note: If you don't want to make users install
# the IO::Capture module just for your tests,
# you can just install in the t/lib directory
# of your module and use the lib pragma in
# your tests.
use lib "t/lib";
use IO::Capture::Stdout;
use Test::More;
my $capture = IO::Capture::Stdout->new;
$capture->start
# execute with a bad parameter to make sure get
# an error.
ok( ! $test("Bad Parameter") );
$capture->stop();
DESCRIPTION
The module "IO::Capture::Stdout", is derived from the abstract class "IO::Capture". See IO::Capture. The purpose of the module (as the
name suggests) is to capture any output sent to "STDOUT". After the capture is stopped, the STDOUT filehandle will be reset to the previ-
ous location. E.g., If previously redirected to a file, when "IO::Capture->stop" is called, output will start going into that file again.
Note: This module won't work with the perl function, system(), or any other operation
involving a fork(). If you want to capture the output from a system command,
it is faster to use open() or back-ticks.
my $output = `/usr/sbin/ls -l 2>&1`;
METHODS
new
o Creates a new capture object.
o An object can be reused as needed, so will only need to do one of these.
o Be aware, any data previously captured will be discarded if a new capture session is started.
start
o Start capturing data into the "IO::Capture" Object.
o Can not be called on an object that is already capturing.
o Can not be called while STDOUT tied to an object.
o "undef" will be returned on an error.
stop
o Stop capturing data and point STDOUT back to it's previous output location I.e., untie STDOUT
read
o In Scalar Context
o Lines are read from the buffer at the position of the "line_pointer", and the pointer is incremented by one.
$next_line = $capture->read;
o In List Context
o The array is returned. The "line_pointer" is not affected.
@buffer = $capture->read;
o Data lines are returned exactly as they were captured. You may want to use "chomp" on them if you don't want the end of line charac-
ter(s)
while (my $line = $capture->read) {
chomp $line;
$cat_line = join '', $cat_line, $line;
}
line_pointer
o Reads or sets the "line_pointer".
my $current_line = $capture->line_pointer;
$capture->line_pointer(1);
SUB-CLASSING
Adding Features
If you would like to sub-class this module to add a feature (method) or two, here is a couple of easy steps. Also see IO::Capture::Over-
view.
1 Give your package a name
package MyPackage;
2 Use this "IO::Capture::Stdout" as your base class like this:
package MyPackage;
use base qw/IO::Capture::Stdout/;
3 Add your new method like this
package MyPackage;
use base qw/IO::Capture::Stdout/;
sub grep {
my $self = shift;
for $line (
}
See Also
IO::Capture::Overview
IO::Capture
IO::Capture::Stderr
AUTHORS
Mark Reynolds reynolds@sgi.com
Jon Morgan jmorgan@sgi.com
COPYRIGHT
Copyright (c) 2003, Mark Reynolds. All Rights Reserved. This module is free software. It may be used, redistributed and/or modified under
the same terms as Perl itself.
perl v5.8.8 2007-07-30 IO::Capture::Stdout(3pm)