shellshoccar-jpn / parsrs Goto Github PK
View Code? Open in Web Editor NEWCSV, JSON, XML text parsers and generators written in pure POSIX shellscript
License: The Unlicense
CSV, JSON, XML text parsers and generators written in pure POSIX shellscript
License: The Unlicense
[_@_ ~]$ parsrx.sh --version
Usage : parsrx.sh [options] [XML_file]
Options : -c Print the child tags in value explicitly
-n Print the array subscript number after the tag name
-lf Replace the newline sign "\n" with <s>.
This option disables replacing \ with \\.
Environs: LINE_BUFFERED
=yes ........ Line-buffered mode if possible
=forcible ... Force line-buffered mode. Exit if unavailable.
Version : 2022-02-06 12:45:01 JST
(POSIX Bourne Shell/POSIX commands)
[_@_ ~]$ makrx.sh --version
Usage : makrx.sh [XPath-value_textfile]
Version : 2020-05-06 22:42:19 JST
(POSIX Bourne Shell/POSIX commands)
[_@_ ~]$
[_@_ ~]$ cat __.xml
<?xml version="1.0" encoding="UTF-8"?>
<foo>
Great!Awsome!
<bar bar="BAR" foo="FOO">Wow!<br /><script /></bar>
</foo>
[_@_ ~]$ parsrx.sh __.xml
/foo/bar/@bar BAR
/foo/bar/@foo FOO
/foo/bar/br
/foo/bar/script
/foo/bar Wow!
/foo \n Great!Awsome!\n \n
[_@_ ~]$ parsrx.sh __.xml | makrx.sh # Missing <foo>
<?xml version="1.0" encoding="UTF-8"?><bar bar="BAR" foo="FOO">Wow!<br /><script /></bar></foo>
[_@_ ~]$ parsrx.sh __.xml | makrx.sh | parsrx.sh
/bar/@bar BAR
/bar/@foo FOO
/bar/br
/bar/script
/bar Wow!
?xml version="1.0" encoding="UTF-8"?>
[_@_ ~]$
$ parsrx.sh __.xml | makrx.sh
<?xml version="1.0" encoding="UTF-8"?><foo><bar bar="BAR" foo="FOO">Wow!<br /><script /></bar></foo>
$
Taken from here
[_@_ ~]$ cat >__r.xml
<root>
<personal>
<![CDATA[toward independent taken locate whose]]>
<safety>meant</safety>
<pale name="fur">1227235817.5203295</pale>
<wash>
<![CDATA[balloon select opinion seed if wheat difficult pleasure eventually dance sunlight favorite course respect]]>electric
</wash>
</personal>
<![CDATA[between grade somewhere vertical foot unknown arrow handle weak]]>
<cross pair="bus">other</cross>
<![CDATA[once announced program fewer]]>
<moment writer="light">trade</moment>
</root>
[_@_ ~]$ parsrx.sh __r.xml
/root/personal/safety meant
/root/personal/pale/@name fur
/root/personal/pale 1227235817.5203295
/root/personal/wash \n <![CDATA[balloon select opinion seed if wheat difficult pleasure eventually dance sunlight favorite course respect]]>electric\n
/root/personal \n <![CDATA[toward independent taken locate whose]]>\n \n \n \n
/root/cross/@pair bus
/root/cross other
/root/moment/@writer light
/root/moment trade
/root \n \n <![CDATA[between grade somewhere vertical foot unknown arrow handle weak]]>\n \n <![CDATA[once announced program fewer]]>\n \n
[_@_ ~]$ parsrx.sh __r.xml | makrx.sh # Missing <root>, <personal>, <wash>, and <![CDATA[....]]>.
<?xml version="1.0" encoding="UTF-8"?><cross pair="bus">other</cross><moment writer="light">trade</moment><pale name="fur">1227235817.5203295</pale><safety>meant</safety></personal></root>
[_@_ ~]$ parsrx.sh __r.xml | makrx.sh | parsrx.sh
/cross/@pair bus
/cross other
/moment/@writer light
/moment trade
/pale/@name fur
/pale 1227235817.5203295
/safety meant
?xml version="1.0" encoding="UTF-8"?>
[_@_ ~]$
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.