Created
July 26, 2019 06:11
-
-
Save alialrahahleh/551de86bc1087c343e23f539b9a77a40 to your computer and use it in GitHub Desktop.
Perl one liner to transform xml to csv
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cat sample.xml | perl -F'[>|<]' -E 'say join(",", @list) and @list = () if $F[1] =~ "/ITEM"; push(@list, $F[2]) if length($F[2]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment