Hi All,
I am having following file and I want to delete 1 row last column.
Current File Content:
================
procedure test421 put_line
procedure test321 test421
procedure test521 test321
procedure test621 test521
Expected File Content:
===========================
procedure... (3 Replies)
I have file which as 12 columns and values like this
1,2,3,4,5
a,b,c,d,e
b,c,a,e,f
a,b,e,a,h
if you see the first column has duplicate values, I need to identify (print it to console) the duplicate value (which is 'a') and also remove duplicate values like below. I could be in two... (5 Replies)
I am a newbie to shell scripting ..
I have a .csv file. It has 1000 some rows and about 7 columns...
but before I insert this data to a table I have to parse it and clean it ..basing on the value of the first column..which a string of phone number type...
example below..
column 1 ... (2 Replies)
Hi,
I want to delete rows that have 0 at column 4.
The file looks like this:
chr01 13 61 2
chr01 65 153 0
chr01 157 309 1
chr01 313 309 0
chr01 317 469 1
chr01 473 557 0
I want to delete all rows with a 0 at column 4
chr01 13 61 2
chr01 157 309 1
chr01 ... (3 Replies)
Hi,
My input file is this way
1.1 0.0 2.4 3.5
7.9 1.8 22.3 4.7 8.9
0.9 1.3 0.0 3.4 5.6
0.0 1.1 2.2 0.0 0.0
1.1 0.0 0.0 3.4 5.6
I would like to delete the entire row, if either of 2nd and 3rd columns are 0.0.
Please note that my values are all decimal values.
So, my output would... (4 Replies)
Hello,
I am new to Linux environment , I working on Linux script which should send auto email based on the specific condition from log file. Below is the sample log file
Name m/c usage
abc xxx 10
abc xxx 20
abc xxx 5
xyz ... (6 Replies)
Hi,
I have an input file as shown below:
20140102;13:30;FR-AUD-LIBOR-1W;2.495
20140103;13:30;FR-AUD-LIBOR-1W;2.475
20140106;13:30;FR-AUD-LIBOR-1W;2.495
20140107;13:30;FR-AUD-LIBOR-1W;2.475
20140108;13:30;FR-AUD-LIBOR-1W;2.475
20140109;13:30;FR-AUD-LIBOR-1W;2.475... (2 Replies)
Dear folks
I have a map file of around 54K lines and some of the values in the second column have the same value and I want to find them and delete all of the same values. I looked over duplicate commands but my case is not to keep one of the duplicate values. I want to remove all of the same... (4 Replies)
Discussion started by: sajmar
4 Replies
LEARN ABOUT CENTOS
yaml::node
YAML::Node(3) User Contributed Perl Documentation YAML::Node(3)NAME
YAML::Node - A generic data node that encapsulates YAML information
SYNOPSIS
use YAML;
use YAML::Node;
my $ynode = YAML::Node->new({}, 'ingerson.com/fruit');
%$ynode = qw(orange orange apple red grape green);
print Dump $ynode;
yields:
--- !ingerson.com/fruit
orange: orange
apple: red
grape: green
DESCRIPTION
A generic node in YAML is similar to a plain hash, array, or scalar node in Perl except that it must also keep track of its type. The type
is a URI called the YAML type tag.
YAML::Node is a class for generating and manipulating these containers. A YAML node (or ynode) is a tied hash, array or scalar. In most
ways it behaves just like the plain thing. But you can assign and retrieve and YAML type tag URI to it. For the hash flavor, you can also
assign the order that the keys will be retrieved in. By default a ynode will offer its keys in the same order that they were assigned.
YAML::Node has a class method call new() that will return a ynode. You pass it a regular node and an optional type tag. After that you can
use it like a normal Perl node, but when you YAML::Dump it, the magical properties will be honored.
This is how you can control the sort order of hash keys during a YAML serialization. By default, YAML sorts keys alphabetically. But notice
in the above example that the keys were Dumped in the same order they were assigned.
YAML::Node exports a function called ynode(). This function returns the tied object so that you can call special methods on it like
->keys().
keys() works like this:
use YAML;
use YAML::Node;
%$node = qw(orange orange apple red grape green);
$ynode = YAML::Node->new($node);
ynode($ynode)->keys(['grape', 'apple']);
print Dump $ynode;
produces:
---
grape: green
apple: red
It tells the ynode which keys and what order to use.
ynodes will play a very important role in how programs use YAML. They are the foundation of how a Perl class can marshall the Loading and
Dumping of its objects.
The upcoming versions of YAML.pm will have much more information on this.
AUTHOR
Ingy doet Net <ingy@cpan.org>
COPYRIGHT
Copyright (c) 2006, 2011-2012. Ingy doet Net. All rights reserved.
Copyright (c) 2002. Brian Ingerson. All rights reserved.
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>
POD ERRORS
Hey! The above document had some coding errors, which are explained below:
Around line 296:
Non-ASCII character seen before =encoding in 'doet'. Assuming UTF-8
perl v5.16.3 2012-07-13 YAML::Node(3)