Linux Archive

Linux Archive (http://www.linux-archive.org/)
-   Fedora User (http://www.linux-archive.org/fedora-user/)
-   -   bash: how run script when file is put into folger and how parse xml file via bash (http://www.linux-archive.org/fedora-user/398113-bash-how-run-script-when-file-put-into-folger-how-parse-xml-file-via-bash.html)

Dario Lesca 07-12-2010 12:45 PM

bash: how run script when file is put into folger and how parse xml file via bash
 
hi, I'm looking for a method for do this thing:

a) when a file is put into a specific folder (via ftp or http or smb), a
shell script must be automatic run.

b) the file is a simple xml and I must parser it and convert it to a csv
file with bash script.

For a) i can use a cron job, but i'm looking for another solution more
efficient and started only when the file is come ...

For b) now I use grep+sed+awk, but I'm looking for a best and more solid
method for extract only some specific field from the file.

Someone can show me, if exist, more better solution for a) and b)?

Many thanks ... and sorry for my bad English :-)

--
Dario Lesca <d.lesca@solinos.it>

--
users mailing list
users@lists.fedoraproject.org
To unsubscribe or change subscription options:
https://admin.fedoraproject.org/mailman/listinfo/users
Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines

Bruno Wolff III 07-12-2010 06:35 PM

bash: how run script when file is put into folger and how parse xml file via bash
 
On Mon, Jul 12, 2010 at 14:45:32 +0200,
Dario Lesca <d.lesca@solinos.it> wrote:
>
> b) the file is a simple xml and I must parser it and convert it to a csv
> file with bash script.
>
> For b) now I use grep+sed+awk, but I'm looking for a best and more solid
> method for extract only some specific field from the file.

You can use xsltproc with an appropriate style sheet. I used this to parse
some xml output from svn for building snapshots for colossus. I didn't find
the documentation on using style sheets for processing xml all that great
but was able to get that simple case to work.
--
users mailing list
users@lists.fedoraproject.org
To unsubscribe or change subscription options:
https://admin.fedoraproject.org/mailman/listinfo/users
Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines


All times are GMT. The time now is 02:56 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.