I am beginner in awk
awk 'BEGIN{for(i=1;(getline<"opnoise")>0;i++) arr=$1}{print arr}'
In the above script, opnoise is a file, I am reading it into an array and then printing the value corresponding to index 20. Well this is not my real objective, but I have posted this example to describe... (19 Replies)
Hi Anyone can help me??i writing a perl using array to translate ip address to the hostname my script are below.this line print "$myhost{$ipaddr}\n"; blank :mad:hostname dint come out:mad::mad:
#!/usr/local/bin/perl
@ipaddr=("192.1.168.2","172.25.1.13","129.1.2.5");
%myhost = { 192.1.168.2... (4 Replies)
The code below prints outs each array element, but it always says the array length is 1 even though its not. What am i doing wrong?
function printArray(){
#here should check if it is an array and that an arg exits
echo "Priting array"
myarr="${@}"
echo... (2 Replies)
Hi, as the title, I have an array @f_lines with gene information in it. How can I put the content of @f_lines into a file so that I can read it?
I tried this:
open(OUTPUT, "file"); # put gene information in this file;
@f_lines = ("gene1", "gene2", "gene3"...); # gene information;
print... (3 Replies)
Hi all,
I been looking for a solution to the fact that when I use:
for (i=1; i<=NF; i++) print $ifields that are originally in a single line are printed in a single line
I have severals files for which the first 7 are the same, but the number of variables after that can vary, for example NF... (5 Replies)
Hey guys,
I'm new to shell scripting and I'm trying to write a script that takes user input and copies the specified columns from a data file to a new one. In order to account for the possibility of a variable number of columns to copy I wrote a loop that encodes the user's choices in an array... (16 Replies)
Hello All,
Can you please help me with the below.
#!/bin/bash
ARR="No Differences In Stage Between HASH_TOTALS & HASH_TOTALS_COMP For UNINUM:0722075 PROVIDER:5 EXTRACT_DT:30-SEP-12 VER_NUM:1"
ARR="No Differences In Stage Between HASH_TOTALS & HASH_TOTALS_COMP For UNINUM:0722075 PROVIDER:5... (14 Replies)
How do i pass an array from test4.sh to a function in another shell script test5.sh, basically i am sourcing the test5.sh in test4.sh and printing the contents, but not working below are my trial scripts, please help, thank you.
#!/bin/bash
# /usr/local/dw/archive/test5.sh
print_array()
{... (5 Replies)
I have test.sh file as below :
set -A IDARR $ID
echo | awk -f test.awk -v TempArr="${IDARR
}"
I have test.awk file as below :
BEGIN {
Flag = 1;
}
{
print "Hello";
for(i in TempArr)
{
print i;
}
} (9 Replies)
In the below awk I am splitting $7 on the : and then counting each line or NM_xxxx. If the $1 value is the same for each line then print the $7 that occurs the most with the matching $1 value. The awk seems close but I am not sure what is going on. I included a description as well as to what I... (1 Reply)
Discussion started by: cmccabe
1 Replies
LEARN ABOUT DEBIAN
geometry::primitive::line
Geometry::Primitive::Line(3pm) User Contributed Perl Documentation Geometry::Primitive::Line(3pm)NAME
Geometry::Primitive::Line - A Line
DESCRIPTION
Geometry::Primitive::Line represents a straight curve defined by two points.
SYNOPSIS
use Geometry::Primitive::Line;
my $line = Geometry::Primitive::Line->new();
$line->start($point1);
$line->end($point2);
ATTRIBUTES
end
Set/Get the end point of the line.
start
Set/Get the start point of the line.
METHODS
new
Creates a new Geometry::Primitive::Line
contains_point
Returns true if the supplied point is 'on' the line. Accepts either a point object or an x y pair.
grow
Does nothing, as I'm not sure how. Patches or hints welcome.
is_parallel ($other_line)
Returns true if the supplied line is parallel to this one.
is_perpendicular ($other_line)
Returns true if the supplied line is perpendicular to this one.
length
Get the length of the line.
point_end
Get the end point. Provided for Shape role.
point_start
Get the start point. Provided for Shape role.
scale
Does nothing at the moment.
slope
Get the slope of the line.
to_string
Guess!
y_intercept
Returns the Y intercept of this line.
AUTHOR
Cory Watson <gphat@cpan.org>
COPYRIGHT & LICENSE
You can redistribute and/or modify this code under the same terms as Perl itself.
perl v5.10.1 2010-01-10 Geometry::Primitive::Line(3pm)