Hi
I wrote this script with the help of you guyz.My next challenge is to increment the port using single file.So far iam using this code to increment hp1 and hp2 .To increment port numbers, iam using two different files (.default_port_hp1 and .default_port_hp2).The challenge for me is to use... (0 Replies)
Hello All,
In the below script i am trying to check and list the file names, get the last file with highest version number and then increment the version number when i create another file. Example: file1 is COBANK_v1.xml and file2 i want to put it as COBANK_v2.xml, to achieve this i am using awk... (15 Replies)
Hi, I have some datatexts with values and I want to replace only the values of the first file with the result of array loaded in one variable.
Also I want the operation difference with the original value replaced and only replace the new value not the character format of the file.
Some Idea?... (24 Replies)
I have a bunch of file numbers in the file 'test':
I'm trying the above command to change all the instances of "H" to "Na+" in the file testsds.pdb at the line numbers indicated in the file 'test'. I've tried the following and various similar alternatives but nothing is working:
cat test |... (3 Replies)
Hi again. Sorry for all the questions — I've tried to do all this myself but I'm just not good enough yet, and the help I've received so far from bartus11 has been absolutely invaluable. Hopefully this will be the last bit of file manipulation I need to do.
I have a file which is formatted as... (4 Replies)
Hi friends,
i need a command which can be used to change the values in file.
I have file which contain some values.
Data_Center_costing=XXXX
Financial_loss=XXXX
operational_cost=XXX
I am not aware about the values of XXXX, They may be 4 digit or less/more than that. but i need these... (12 Replies)
Hi All
Been trying to get something working but having some trouble in unix bash or ksh scripting.
Im trying to increment once a condition has been met
Say I have a file that contains:
apple
orange
banana
grapes
dates
kiwi
What im after is once a counter has reached every second... (3 Replies)
Two questions:
1) Is there a way to create a new column (i.e. ID) to an existing file containing data and the new column ID populate as an auto incrementing number?
for example:
(Current file has headers and is PIPE delimited.)
**data looks like this**
"COL1"|"COL2"|"COL3"|"COL4"|"COL5"... (4 Replies)
Hi,
This is my first post here.
I am using cygwin on Windows 7.
I am starting with a data file with filename "name_1.ext", like "20180831_snapgenotypes_1.csv".
The "_1" before ".ext" is a version number. Integers (0-99) are sufficient. They don't have to be like "1.0.0".
The filename may... (2 Replies)
Discussion started by: minimalist
2 Replies
LEARN ABOUT DEBIAN
mousex::nativetraits::hashref
MouseX::NativeTraits::HashRef(3pm) User Contributed Perl Documentation MouseX::NativeTraits::HashRef(3pm)NAME
MouseX::NativeTraits::HashRef - Helper trait for HashRef attributes
SYNOPSIS
package Stuff;
use Mouse;
has 'options' => (
traits => ['Hash'],
is => 'ro',
isa => 'HashRef[Str]',
default => sub { {} },
handles => {
set_option => 'set',
get_option => 'get',
has_no_options => 'is_empty',
num_options => 'count',
delete_option => 'delete',
pairs => 'kv',
},
);
DESCRIPTION
This module provides a Hash attribute which provides a number of hash-like operations.
PROVIDED METHODS
These methods are implemented in MouseX::NativeTraits::MethodProvider::HashRef.
get($key, $key2, $key3...)
Returns values from the hash.
In list context return a list of values in the hash for the given keys. In scalar context returns the value for the last key
specified.
set($key => $value, $key2 => $value2...)
Sets the elements in the hash to the given values.
delete($key, $key2, $key3...)
Removes the elements with the given keys.
exists($key)
Returns true if the given key is present in the hash.
defined($key)
Returns true if the value of a given key is defined.
keys
Returns the list of keys in the hash.
sorted_keys
Returns the list of sorted keys in the hash.
values
Returns the list of values in the hash.
kv Returns the key/value pairs in the hash as an array of array references.
for my $pair ( $object->options->pairs ) {
print "$pair->[0] = $pair->[1]
";
}
elements
Returns the key/value pairs in the hash as a flattened list.
clear
Resets the hash to an empty value, like "%hash = ()".
count
Returns the number of elements in the hash. Also useful for not empty: "has_options => 'count'".
is_empty
If the hash is populated, returns false. Otherwise, returns true.
accessor
If passed one argument, returns the value of the specified key. If passed two arguments, sets the value of the specified key.
METHODS
meta
method_provider_class
helper_type
SEE ALSO
MouseX::NativeTraits
perl v5.14.2 2011-12-04 MouseX::NativeTraits::HashRef(3pm)