Hi,
in my korn shell I have this code:
typeset -uL1 rc
read rc?"Insert Y=Yes (default) or N=No >>"
If I press enter without value I wish to set rc=Y. This is my default.
This test: if ] then .... Do not work.
I hope in your help. Thanks in advance.
Regards,
Giovanni (3 Replies)
--------------------------------------------------------------------------------
Hi All
I have a field being returned from the DB that when opened in Vi shows a ^M before the rest of the field is displayed on the next line.
I need it so that the only newline character is the end of the... (14 Replies)
Hi,
I have a problem with sed. It doesn't recognize the "\n" character. It substitudes an "n", instead of introducing a new line.
This doesn't happend with print $ print "test \n \n" (it deos introduce two lines after hello)
(AIX)
$ sed s/bc/\n/g test.1 >test.2
$ cat test.1
bcdefg... (3 Replies)
Hi all,
I have a huge csv file with the following format of data,
Num SNPs, 549997
Total SNPs,555352
Num Samples, 157
SNP, SampleID, Allele1, Allele2
A001,AB1,A,A
A002,AB1,A,A
A003,AB1,A,A
...
...
...
I would like to write out a list of unique SNP (column 1). Could you... (3 Replies)
hi,
I want to search all files in the current working direcotry and to print in comma (,) seperated output. But I have two patterns to search for.
Files will be in ABC20100508.DAT format.
Search should happen on the format (ABC????????.DAT) along with date(20100508).
I can do a
ls... (2 Replies)
My input strings look something like this:
/dev/vs/dsk/group/vol
I want to print just "group" out of the line... which is always found between the 4th and 5th "/" in the string.
I figure I have to use awk, sed, or some combination to do this, but I've searched the forums and can't find... (2 Replies)
Hello , this is my first topic cause I need your little help:(
I got .txt file, and I want to find lines without letter 'a', so im writing:
grep "" list.txt (list.txt is the file of course)
and i have no idea why it's not working because it shows lines with a. (1 Reply)
Is there a simple way to find the longest common prefix of a space-separated list of strings, optionally by field?
For example, given input:
"aaa_b_cc aaa_b_cc_ddd aaa_b_cc aaa_b_cd"with no field separator, output:
aaa_b_cwith _ field separator, output:
aaa_bI have an awk solution which... (1 Reply)
Dear All,
assume i have a file with content:
<Start>6000</Start>
<Stop>7599</Stop>
the output is:
6000
7000
7100
7200
7300
7400
7599
how should we use any awk, sed, perl can do this task, means to extract the uniq prefixes from the start and stop prefix.
Thanks
Jimmy (3 Replies)
Discussion started by: jimmy_y
3 Replies
LEARN ABOUT DEBIAN
math::polygon::clip
Math::Polygon::Clip(3pm) User Contributed Perl Documentation Math::Polygon::Clip(3pm)NAME
Math::Polygon::Clip - frame a polygon in a square
INHERITANCE
Math::Polygon::Clip
is a Exporter
SYNOPSIS
my @poly = ( [1,2], [2,4], [5,7], [1, 2] );
my @box = ( $xmin, $ymin, $xmax, $ymax );
my $boxed = polygon_clip @box, @poly;
DESCRIPTION
Cut-off all parts of the polygon which are outside the box
FUNCTIONS
polygon_fill_clip1(ARRAY-BOX, LIST-OF-POINTS)
Clipping a polygon into rectangles can be done in various ways. With this algorithm (which I designed myself, but may not be new), the
parts of the polygon which are outside the BOX are mapped on the borders. The polygon stays in one piece.
Returned is one list of points, which is cleaned from double points, spikes and superfluous intermediate points.
polygon_fill_clip2(ARRAY-BOX, LIST-OF-POINTS)
To be implemented. The polygon falls apart in fragments, which are not connected: paths which are followed in two directions are
removed. This is required by some applications, like polygons used in geographical context (country contours and such).
polygon_fill_clip3(ARRAY-BOX, OUT-POLY, [IN-POLYS])
To be implemented. A surrounding polygon, with possible inclussions.
polygon_line_clip(ARRAY-BOX, LIST-OF-POINTS)
Returned is a list of ARRAYS (possibly 0 long) containing line pieces from the input polygon (or line).
example:
my @points = ( [1,2], [2,3], [2,0], [1,-1], [1,2] );
my @bbox = ( 0, -2, 2, 2 );
my @l = polygon_line_clip @bbox, @points;
print scalar @l; # 1, only one piece found
my @first = @{$l[0]}; # first is [2,0], [1,-1], [1,2]
SEE ALSO
This module is part of Math-Polygon distribution version 1.02, built on September 19, 2011. Website: http://perl.overmeer.net/geo/
LICENSE
Copyrights 2004,2006-2011 by Mark Overmeer. For other contributors see ChangeLog.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See
http://www.perl.com/perl/misc/Artistic.html
perl v5.12.4 2011-09-19 Math::Polygon::Clip(3pm)