0

hi,

i want to send my perl output to a notepad. is it possible..

for instant,

my perl result with some dna sequence should be copied to a new text file. is it possbile... can any one help me.

4
Contributors
3
Replies
4
Views
7 Years
Discussion Span
Last Post by onaclov2000
0

Well you could direct the output to a file, then invoke notepad with that file.

Would that work?

Making it one step shorter could get unbelievably messy in a hurry, and for what benefit?

0

As Salem says, redirect the output to a file. For example, lets say I have a script called "my_program.pl" that prints output onto the screen. If I want to have that output go into a file instead, so I can open it with Notepad or some other program, I would enter perl my_program.pl > my_output.txt on the command line (in the cmd box in Windows). This results in the output of the program going into a new file called my_output.txt instead of displaying on the screen.

Edited by d5e5: n/a

0

I guess a simple solution would be to change your print to this:

$file = "somefileyouwanttostoreto.txt";
open(OUT, ">$file");
print OUT "strings that you want to output to file";
close(OUT);

Not too hard to actually include the file itself in your code,

Basically if you're currently doing "print" you would just replace it with "print OUT" in the cases where you want to output.

The Filename can be somewhat dynamic in that you can make it's name based on the current date/iteration of your file.

Thank you,
onaclov

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.