After the success of the jq - tool for parsing and manipulating JSON-Data someone wrote a tool called yq, which aims to be the same for YAML, what jq is for JSON. Seems to work fine. I'll definitely give it a chance in future.
Example YAML-File:
yq - Usage:
It's already available via repository in newer versions of major linux distributions
Hi
How to create a shell script which takes in to account all the files present within a directory DIR one by one
e.g.
suppose i have a directory named DIR where there are files with the extension .ABC
i want to create shell script which processes all these files one by one.
... (1 Reply)
I have the following two files:
1st File:
1:1:100
2:101:400
3:401:450
4:451:600
5:601:980
6:981:1500
7:1501:1600
8:1601:1800
9:1801:2000
2nd File:
30
50
80
700 (2 Replies)
Hi
I have the folowing input file, the file looks like below
sftp>
.
..
archive
x001_ameint*.zip
x001_ameint_1.zip
x001_ameint_2.zip
x001_REPORTS*.zip
x001_REPORTS_1.zip
sftp>
I want my output to look like this
x001_ameint*.zip
x001_ameint_1.zip
x001_ameint_2.zip (1 Reply)
Hi all,
I am stuck with a ruby script that extracts detials from yaml file and processes accordingly.
the yaml file
confivnic:
device:
vnic1:
policy:
- L2
mode: active
vnic2:
policy:
- L3
- L4
mode: active
type: aggr
... (1 Reply)
Hi All,
I have a directory in which there will be several files. i want to get all the files and pass it to a piece of code for processing on the files.
This is the piece of code which does the processing.
tr "\n" "|" < (log file name) | tr "$" "\n" > output
echo ' ' >>output
while... (1 Reply)
Hi everyone!
Hope all of you will be fine. I am new to this forum.
Well, I am trying to configure yaml-0.1.4 in cygwin on Windows 7.
I have written the following command:
*******/tmp/yaml-0.1.4
$ ./configure --prefix=/usr && make && make install
and the following error appeared.
... (3 Replies)
Hi,
I have typical logs file something of these formats -
fn2013.12.13.log
fn2013.12.13_a.log
fn2013.12.13_b.log
suffix part is after the underscore ( ie a.log or b.log )
I need to process the files in ascending date order, but descending suffix order, and check if the file exist and... (12 Replies)
We have regularly questions about how to create users and user accounts. But regularly user accounts need to be deleted too. It is quite easy to delete the user account itself but usually the HOME directory of the user remains.
It is good style to remove these directories but simply deleting... (3 Replies)
Discussion started by: bakunin
3 Replies
LEARN ABOUT MOJAVE
cpan::meta::yaml
CPAN::Meta::YAML(3pm) Perl Programmers Reference Guide CPAN::Meta::YAML(3pm)NAME
CPAN::Meta::YAML - Read and write a subset of YAML for CPAN Meta files
VERSION
version 0.008
SYNOPSIS
use CPAN::Meta::YAML;
# reading a META file
open $fh, "<:utf8", "META.yml";
$yaml_text = do { local $/; <$fh> };
$yaml = CPAN::Meta::YAML->read_string($yaml_text)
or die CPAN::Meta::YAML->errstr;
# finding the metadata
$meta = $yaml->[0];
# writing a META file
$yaml_text = $yaml->write_string
or die CPAN::Meta::YAML->errstr;
open $fh, ">:utf8", "META.yml";
print $fh $yaml_text;
DESCRIPTION
This module implements a subset of the YAML specification for use in reading and writing CPAN metadata files like META.yml and MYMETA.yml.
It should not be used for any other general YAML parsing or generation task.
NOTE: META.yml (and MYMETA.yml) files should be UTF-8 encoded. Users are responsible for proper encoding and decoding. In particular, the
"read" and "write" methods do not support UTF-8 and should not be used.
SUPPORT
This module is currently derived from YAML::Tiny by Adam Kennedy. If there are bugs in how it parses a particular META.yml file, please
file a bug report in the YAML::Tiny bugtracker: <http://rt.cpan.org/NoAuth/ReportBug.html?Queue=YAML-Tiny>
SEE ALSO
YAML::Tiny, YAML, YAML::XS
SUPPORT
Bugs / Feature Requests
Please report any bugs or feature requests through the issue tracker at <http://rt.cpan.org/Public/Dist/Display.html?Name=CPAN-Meta-YAML>.
You will be notified automatically of any progress on your issue.
Source Code
This is open source software. The code repository is available for public review and contribution under the terms of the license.
<https://github.com/dagolden/cpan-meta-yaml>
git clone https://github.com/dagolden/cpan-meta-yaml.git
AUTHORS
o Adam Kennedy <adamk@cpan.org>
o David Golden <dagolden@cpan.org>
COPYRIGHT AND LICENSE
This software is copyright (c) 2010 by Adam Kennedy.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
perl v5.18.2 2014-01-06 CPAN::Meta::YAML(3pm)