I have a text file which represents a http flow like this:
HTTP/1.1 200 OK
Date: Fri, 23 Jan 2009 17:16:24 GMT
Server: Apache
Last-Modified: Fri, 23 Jan 2009 17:08:03 GMT
Accept-Ranges: bytes
Cache-Control: max-age=540
Expires: Fri, 23 Jan 2009 17:21:31 GMT
Vary: Accept-Encoding ... (1 Reply)
Hi,
I am having trouble converting a text file. I have been working for this whole day now, still i couldn't make it.
Here is how the text file looks:
_______________________________________________________
DEVICE STATUS INFORMATION FOR LOCATION 1:
OPER STATES: Disabled E:Enabled ... (5 Replies)
Hi,
I have the following text file:
8 T1mapping_flip02 ok 128 108 30 1 665000-000008-000001.dcm
9 T1mapping_flip05 ok 128 108 30 1 665000-000009-000001.dcm
10 T1mapping_flip10 ok 128 108 30 1 665000-000010-000001.dcm
11 T1mapping_flip15 ok 128 108 30... (2 Replies)
Hey all,
I'm looking for a command that will search a directory (and all subdirectories) and give me a file count for the number of files that contain specific characters within its filename. e.g. I want to find the number of files that contain "-a.jpg" in their name.
All the searching I've... (6 Replies)
Hi,
I need help to count the number of occurrences in $3 of file1.txt. I only know how to count by checking one by one and the code is like this:
awk '$3 ~ /aku hanya poyo/ {++c} END {print c}' FS="\t" file1.txt
But this is not wise to do as i have hundreds of different occurrences in that... (10 Replies)
I am trying to find a specific set of characters in a long file. I only want to find the characters in column 265 for 4 bytes.
Is there a search for that? I tried cut but couldn't get it to work.
Ex. I want to find '9999' in column 265 for 4 bytes. If it is in there, I want it to print... (12 Replies)
Hi all:
quick question!
I have the following data that resembles some thing like this:
i am tired
tired am i
what is up
hello people cool
I want to count (or at least isolate) all of the unique elements in the 2nd column.
I have tried this:
cut -f 2 | uniq 'input'
which does... (3 Replies)
Hi, I have tab-deliminated data similar to the following:
dot is-big 2
dot is-round 3
dot is-gray 4
cat is-big 3
hot in-summer 5
I want to count the frequency of each individual "unique" value in the 1st column. Thus, the desired output would be as follows:
dot 3
cat 1
hot 1
is... (5 Replies)
I have an xml file dumped from rrd file, that I want to "patch" so the xml file doesn't contain any blank hole in the resulting graph of the rrd file.
Here is the file.
<!-- 2015-10-12 14:00:00 WIB / 1444633200 --> <row><v> 4.0419731265e+07 </v><v> 4.5045912770e+06... (2 Replies)
Hi,
I have a file with hundreds of lines. I want to search for particular lines starting with 4000, search and replace the 137-139 position characters; which will be '000', with '036'. Can all of this be done without opening a temp file and then moving that temp file to the original file name.
... (7 Replies)
Discussion started by: dsid
7 Replies
LEARN ABOUT DEBIAN
term::size
Size(3pm) User Contributed Perl Documentation Size(3pm)NAME
Term::Size - Retrieve terminal size (Unix version)
SYNOPSIS
use Term::Size;
($columns, $rows) = Term::Size::chars *STDOUT{IO};
($x, $y) = Term::Size::pixels;
DESCRIPTION
Term::Size is a Perl module which provides a straightforward way to retrieve the terminal size.
Both functions take an optional filehandle argument, which defaults to *STDIN{IO}. They both return a list of two values, which are the
current width and height, respectively, of the terminal associated with the specified filehandle.
"Term::Size::chars" returns the size in units of characters, whereas "Term::Size::pixels" uses units of pixels.
In a scalar context, both functions return the first element of the list, that is, the terminal width.
The functions may be imported.
If you need to pass a filehandle to either of the "Term::Size" functions, beware that the *STDOUT{IO} syntax is only supported in Perl
5.004 and later. If you have an earlier version of Perl, or are interested in backwards compatibility, use *STDOUT instead.
EXAMPLES
1. Refuse to run in a too narrow window.
use Term::Size;
die "Need 80 column screen" if Term::Size::chars *STDOUT{IO} < 80;
2. Track window size changes.
use Term::Size 'chars';
my $changed = 1;
while(1) {
local $SIG{'WINCH'} = sub { $changed = 1 };
if ($changed) {
($cols, $rows) = chars;
# Redraw, or whatever.
$changed = 0;
}
}
RETURN VALUES
Both functions return "undef" if there is an error.
If the terminal size information is not available, the functions will normally return "(0, 0)", but this depends on your system. On
character only terminals, "pixels" will normally return "(0, 0)".
BUGS
It only works on Unix systems.
AUTHOR
Tim Goodwin, <tim@uunet.pipex.com>, 1997-04-23.
Candidate for maintainership: Adriano Ferreira, <ferreira@cpan.org>, 2006-05-19.
perl v5.14.2 2012-03-04 Size(3pm)