02-17-2015
Note: RS may only contain a regex in gawk and mawk. In regular awk only the first character is used.
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I have a .csv file that I would like to count on each line the occurences of the coma. Each line should have the same amount, but as an integrity check I would like to include in my script this count.
What is the best way of doing this? (3 Replies)
Discussion started by: dbrundrett
3 Replies
2. Shell Programming and Scripting
Whats the basic difference between double inverted comma and single inverted comma and no comma applied at all?
Eg1 if
Eg2 if
iEg3 f (1 Reply)
Discussion started by: abhisekh_ban
1 Replies
3. Shell Programming and Scripting
Hello,
I have two files that I need to compare and print out the line from file2 that has the first 6 fields matching the first 6 fields in file1. Complicating this are the following restrictions
1. file1 is only a few thousand lines at most and file2 is greater than 2 million
2. I need to... (7 Replies)
Discussion started by: gillesc_mac
7 Replies
4. Shell Programming and Scripting
I have a .csv file which is seperated with (;)
inputfile
---------
ZZZZ;AAAA;BBB;CCCC;DDD;EEE;
YYYY;BBBB;CCC;DDDD;EEE;FFF;
...
...
reading file line by line till end of file.
while reading each line output format should be .
i need to print only specific columns let say 5th... (2 Replies)
Discussion started by: rocking77
2 Replies
5. Shell Programming and Scripting
Korn Shell in AIX 6.1
I want to print the below shown pipe (|) separated list line by line.
line=es349889|nhb882309|ts00293|snh03524|bg578835|bg37900|rnh00297|py882201|sg175883
for i in line
do
echo "Hello $line "
done
I wanted to execute the above for loop. But i can't even set the... (3 Replies)
Discussion started by: polavan
3 Replies
6. Shell Programming and Scripting
Dear All,
fileName: therm.txt
nc3h7o2h 7/27/98 thermc 3h 8o 2 0g 300.000 5000.000 1390.000 41
1.47017550e+01 1.71731699e-02-5.91205329e-06 9.21842570e-10-5.36438880e-14 2
-2.99988556e+04-4.93387892e+01 2.34710908e+00 4.34517484e-02-2.65357553e-05 3
... (7 Replies)
Discussion started by: linuxUser_
7 Replies
7. Shell Programming and Scripting
Hello,
I have below format log file,
Comparing csv_converted_files/2201/9747.1012H67126.5077292103609547345.csv and csv_converted_files/22019/97447.1012H67126.5077292103609547345.csv
Comparing csv_converted_files/2559/9447.1012H67126.5077292103609547345.csv and... (6 Replies)
Discussion started by: arvindshukla81
6 Replies
8. UNIX for Beginners Questions & Answers
example of problem:
when I echo "$e" >> /home/cogiz/file.txt
result prints to file as:AA
BB
CC
I need it to save to file as this:AA BB CC
I know it's probably something really simple but any help would be greatly appreciated.
Thank You.
Cogiz (7 Replies)
Discussion started by: cogiz
7 Replies
9. Shell Programming and Scripting
Hello,
I am looking for a specific situation in a text file. The conditions are,
> <CompoundName>
InChI=1S/C5H12NO2/c1-5(2)4-8-6(3)7/h5H,4H2,1-3H3/q+1
I am looking for cases where the line "> <CompoundName>" is followed by a line that contains the string "InChI=" without regard to... (5 Replies)
Discussion started by: LMHmedchem
5 Replies
10. UNIX for Beginners Questions & Answers
Hi All,
i want to write a shell script read below file line by line and want to exclude the lines which contains empty value for MOUNTPOINT field.
i am using centos 7 Operating system.
want to read below file.
# cat /tmp/d5
NAME="/dev/sda" TYPE="disk" SIZE="60G" OWNER="root"... (4 Replies)
Discussion started by: balu1234
4 Replies
LEARN ABOUT SUSE
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 dA~Xt Net <ingy@cpan.org>
COPYRIGHT
Copyright (c) 2006. Ingy dA~Xt 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>
perl v5.12.1 2010-01-03 YAML::Node(3)