Jump to content

Recommended Posts

Hi Everyone,

 

I have a perl script and a java sript.

 

I need to run the perl script first and parser a txt file and then run a java scrip to convert that file to a png.

 

here is an example of the script I will have to run.

 

both this command on the terminal to get an output file (output.png)

 

 

1. perl xml_builder.pl -sequence /sequences.txt -output /data/done_sequesnces.xml -tick_density 0.7

2. java -jar view.jar -i /data/done_sequesnces.xml -o /data/output.png -f png

 

I have to run both this command on the terminal to get an output file (output.png)

 

is there a way I can and html or a php page that instead of using a text file (sequences.txt)  I can past the text in a text box or if not upload the txt file.

 

And when pressed submit it will run the Perl script and the Java script to output the png file to a folder?

 

I know its seesm to be allot to ask, but I know there are excellent programmers here who can do wonders. I am at a very basic level of programming.  :shrug:

 

Any Help Will be Much appreciated.

 

Thank you in advance.

Link to comment
https://forums.phpfreaks.com/topic/200953-text-input-run-perl-script-java-output/
Share on other sites

Hi Im not sure the xml_builder.pl has a the option to accept stlin. and sorry about my the Java script misunderstanding  :confused:.

 

what I was thinking is to have a text box when I submit some text through  it creates a text file and that text file is then ran through the xml_builder.pl using exec and the resulting file is again run through the jar file and the final image to be displayed in the browser. is this possible?

 

Text box ---> textfile ---> execute perl script on text --- xml output ---> java ---> image

what I was thinking is to have a text box when I submit some text through  it creates a text file and that text file is then ran through the xml_builder.pl using exec and the resulting file is again run through the jar file and the final image to be displayed in the browser. is this possible?

 

It is possible, but likely not required as most Perl scripts should accept data from stdin. I suggest you find out if it does or not.

it doesn't. is there any other way this can be done? at least a method where the input text is stored in temp file and the file is assigned to variables so I can pass it through the command. I'm sorry if I'm asking something hard. any help is much appreciated.

 

Thank you.

it doesn't

 

Can we see this script?

 

is there any other way this can be done? at least a method where the input text is stored in temp file and the file is assigned to variables so I can pass it through the command.

 

You could do that quite easily using file_put_contents.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.