I would like to associate in the same line all values taking as common value $1. I mean, compare the values in column 1 for consecutive lines, and
if $1 of line_n is equal to $1 of line_n+1 put the data as follow:
I think this could be done using FNR and/or NR variables, but I donīt know
how to use them for this task.
I was trying the next line, but fails because some syntax error:
i have two file and i am comparing both..
in cmp1 ,the content is :
the nu of file is : <some integer value>
in cmp2 ,the content is :
the nu of file is :
so want a script which will take value (2) when cmp1 is compared with cmp2..
i mean cmp cmp1 cmp2 the the output will be
he nu of... (1 Reply)
Dear Guyz:)
I have 2 different input files like this. I would like to pick the values or letters from the inputfile2 based on inputfile1 keys (A,F,N,X,Z).
I have done similar task by using awk but in that case the inputfiles are similar like in inputfile2 (all keys in 1st column and values in... (16 Replies)
Hi All,
I have a file which is having 3 columns as (string string integer)
a b 1
x y 2
p k 5
y y 4
.....
.....
Question:
I want get the unique value of column 2 in a sorted way(on column 2) and the sum of the 3rd column of the corresponding rows. e.g the above file should return the... (6 Replies)
Hi friends,
My file is like:
Second file is :
I need to print the rows present in file one, but in order present in second file....I used
while read gh;do
awk ' $1=="' $gh'" {print >> FILENAME"output"} ' cat listoffirstfile
done < secondfile
but the output I am... (14 Replies)
I have results from some statistical analyses.
The format of the results are as given below:
I want to select lines that have a p-value (last column) less than 0.05 from all the results files (*.results) and cat to a new results file.
It would be very nice if a new column is added that tells... (2 Replies)
Hi Gurus,
I have a tab separated text file with two columns. I would like to make the first column values as headings for the second column values.
Ex.
>value1 subjects
>value2 priorities
>value3 requirements
...etc
and I want to have a file
>value1
subjects
>value2
priorities... (4 Replies)
I have two text files where the first three columns are exactly the same. I want to compare the fourth column of the text files and if the values are different, print that row into a new output file. How do I go about doing that?
File 1:
100 rs3794811 0.01 0.3434
100 rs8066551 0.01... (8 Replies)
Hello All,
I have a below data in a .csv file where all rows where col1 is A, col2 is odd numbers, similarly even numbers for all rows where col1 is B.
Note that my data has some other columns(not shown here) too (around 100) after col2.
Tool,Data
A,1
A,3
A,5
....
so on
B,2
B,4
.... ... (4 Replies)
Hi,
My input files is like this
axis1 0 1 10
axis2 0 1 5
axis1 1 2 -4
axis2 2 3 -3
axis1 3 4 5
axis2 3 4 -1
axis1 4 5 -6
axis2 4 5 1
Now, these are my following tasks
1. Print a first column for every two rows that has the same value followed by a string.
2. Match on the... (3 Replies)
First I'd like to apologize if I opened a thread which is already open somewhere.
I did a bit of searching but could quite find what I was looking for, so I will try to explaing what I need.
I'm writing a script on our server, got to a point where I have two files with results. Example:
File1... (6 Replies)
Discussion started by: mitabrev83
6 Replies
LEARN ABOUT MOJAVE
dumpvalue
Dumpvalue(3pm) Perl Programmers Reference Guide Dumpvalue(3pm)NAME
Dumpvalue - provides screen dump of Perl data.
SYNOPSIS
use Dumpvalue;
my $dumper = Dumpvalue->new;
$dumper->set(globPrint => 1);
$dumper->dumpValue(*::);
$dumper->dumpvars('main');
my $dump = $dumper->stringify($some_value);
DESCRIPTION
Creation
A new dumper is created by a call
$d = Dumpvalue->new(option1 => value1, option2 => value2)
Recognized options:
"arrayDepth", "hashDepth"
Print only first N elements of arrays and hashes. If false, prints all the elements.
"compactDump", "veryCompact"
Change style of array and hash dump. If true, short array may be printed on one line.
"globPrint"
Whether to print contents of globs.
"dumpDBFiles"
Dump arrays holding contents of debugged files.
"dumpPackages"
Dump symbol tables of packages.
"dumpReused"
Dump contents of "reused" addresses.
"tick", "quoteHighBit", "printUndef"
Change style of string dump. Default value of "tick" is "auto", one can enable either double-quotish dump, or single-quotish by
setting it to """ or "'". By default, characters with high bit set are printed as is. If "quoteHighBit" is set, they will be quoted.
"usageOnly"
rudimentary per-package memory usage dump. If set, "dumpvars" calculates total size of strings in variables in the package.
unctrl
Changes the style of printout of strings. Possible values are "unctrl" and "quote".
subdump
Whether to try to find the subroutine name given the reference.
bareStringify
Whether to write the non-overloaded form of the stringify-overloaded objects.
quoteHighBit
Whether to print chars with high bit set in binary or "as is".
stopDbSignal
Whether to abort printing if debugger signal flag is raised.
Later in the life of the object the methods may be queries with get() method and set() method (which accept multiple arguments).
Methods
dumpValue
$dumper->dumpValue($value);
$dumper->dumpValue([$value1, $value2]);
Prints a dump to the currently selected filehandle.
dumpValues
$dumper->dumpValues($value1, $value2);
Same as "$dumper->dumpValue([$value1, $value2]);".
stringify
my $dump = $dumper->stringify($value [,$noticks] );
Returns the dump of a single scalar without printing. If the second argument is true, the return value does not contain enclosing
ticks. Does not handle data structures.
dumpvars
$dumper->dumpvars('my_package');
$dumper->dumpvars('my_package', 'foo', '~bar$', '!......');
The optional arguments are considered as literal strings unless they start with "~" or "!", in which case they are interpreted as
regular expressions (possibly negated).
The second example prints entries with names "foo", and also entries with names which ends on "bar", or are shorter than 5 chars.
set_quote
$d->set_quote('"');
Sets "tick" and "unctrl" options to suitable values for printout with the given quote char. Possible values are "auto", "'" and """.
set_unctrl
$d->set_unctrl('unctrl');
Sets "unctrl" option with checking for an invalid argument. Possible values are "unctrl" and "quote".
compactDump
$d->compactDump(1);
Sets "compactDump" option. If the value is 1, sets to a reasonable big number.
veryCompact
$d->veryCompact(1);
Sets "compactDump" and "veryCompact" options simultaneously.
set
$d->set(option1 => value1, option2 => value2);
get
@values = $d->get('option1', 'option2');
perl v5.18.2 2013-11-04 Dumpvalue(3pm)