[esp-r] Re: Scripting and Perl

Gian Luca Brunetti gianluca.brunetti at polimi.it
Wed Oct 30 16:20:46 GMT 2013


I am sorry. I now realize I had not fully understood the question.

I am afraid I cannot be of help about it, since I never used the xml output.

(I usually make a program read the bps-made plain text grt files, spot the information I need with regular expressions and push it in memory or print it (in csv format or plain text) with a print loop.)

Best regards

Gian Luca Brunetti

________________________________________
From: esp-r-bounces at lists.strath.ac.uk <esp-r-bounces at lists.strath.ac.uk> on behalf of Amar Seeam <amar.seeam at strath.ac.uk>
Sent: Wednesday, October 30, 2013 2:57 PM
To: Gian Luca Brunetti
Cc: esp-r at lists.strath.ac.uk
Subject: [esp-r] Re: Scripting and Perl

Thanks,

It's still not clear what command line calls I need for bps to output
CSV with a res file.

I have configured input.xml and placed it in the cfg directory, and
configured H3K reports, placed a path to xsl directory and selected CSV,
but there is no CSV file to be found.

Amar,

On Tue, 2013-10-29 at 16:32 +0000, Gian Luca Brunetti wrote:
> Hi Amar,
> when you'll take at look at Perl after you'll have studied some example shell scripts, you'll see that the input to the shell is (comparatively) easy with Perl, because of Perl's capability of variable interpolation (like Ruby, for instance).
>
> Basically, you have to print to the shell what you would type to the keyboard.
>
> The following script for example will move a zone:
>
> print `prj -file $file -mode script<<YYY
>
> m
> c
> a
> $zone
> i
> e
> $x_movement $y_movement $z_movement
> y
> $yes_or_no
> -
> y
> c
> -
> -
> -
> -
> -
> -
> -
> -
> YYY
> `;
>
> The backquotes makes you enter the shell and exit from it.
>
> The advantage of Perl over, say, Python in this case is that variables are named instead of attributed by position (order); which may make the scripts look clearer.
>
> About the CSV output with Perl, I think that basically it is a matter of printing (items separated by commas).
>
> If you already have a table on a file, I think that you may convert it in csv format using regular expressions instead.
>
> Best regards
>
> Gian Luca Brunetti
>
>
> ________________________________________
> From: esp-r-bounces at lists.strath.ac.uk <esp-r-bounces at lists.strath.ac.uk> on behalf of Amar Seeam <amar.seeam at strath.ac.uk>
> Sent: Tuesday, October 29, 2013 3:42 PM
> To: esp-r at lists.strath.ac.uk
> Subject: [esp-r]  Scripting and Perl
>
> Hi all,
>
> I would like some help with scripting. Basically I would like to
> automate runs based on various .cfg files and output the simulation data
> in CSV format (for further processing and other perl scripts).
>
> I have tried to read through the perl scripts in the source branch
> (tester.pl ) but was wondering if there are any other supporting
> documentation (...or simpler scripts) for this or if there are specific
> command line switches I need to instantiate and run bps to generate the
> CSV files as result output (with user specified columns as well).
>
> Thanks in advance.
>
> Amar.
>
>
> _______________________________________________
> esp-r mailing list
> esp-r at lists.strath.ac.uk
> http://lists.strath.ac.uk/mailman/listinfo/esp-r



_______________________________________________
esp-r mailing list
esp-r at lists.strath.ac.uk
http://lists.strath.ac.uk/mailman/listinfo/esp-r


More information about the esp-r mailing list