Editor

T

tyjb

I'd like to display the contents of a file to users giving them the
opportunity to search or scroll, but not allow them to change or
save. I can't use the "type" command because the files are too
large. Any suggestions?

This is what I'm currently doing, but need another method.

$myfile = $sortedarray[$input];
$mypath = '\\\\tlrntfs1\\IT_Common\\output\\';
$myprogram = '"C:\\Windows\\notepad.exe"';
$mycommand = $myprogram.' "'.$mypath.$myfile ;
system($mycommand);
 
Q

QoS

tyjb said:
I'd like to display the contents of a file to users giving them the
opportunity to search or scroll, but not allow them to change or
save. I can't use the "type" command because the files are too
large. Any suggestions?

This is what I'm currently doing, but need another method.

$myfile = $sortedarray[$input];
$mypath = '\\\\tlrntfs1\\IT_Common\\output\\';
$myprogram = '"C:\\Windows\\notepad.exe"';
$mycommand = $myprogram.' "'.$mypath.$myfile ;
system($mycommand);

You could try a Scrolled ROText widget from the Tk set of modules.

#/usr/bin/perl
use strict;
use warnings;
use Tk;
use Tk::ROText;

my($mw,);
$mw = MainWindow->new(-title => 'Tk ROText example');
&gui();
&Tk::MainLoop();

exit;

sub gui
{
my($txt1,);
$txt1 = $mw->Scrolled('ROText', -scrollbars => 'se',)->pack();
my $stuffToDisplay = "test\n"x50;
$txt1->insert('1.0', $stuffToDisplay);
}
 
K

Kevin Sproule

tyjb said:
I'd like to display the contents of a file to users giving them the
opportunity to search or scroll, but not allow them to change or
save. I can't use the "type" command because the files are too
large. Any suggestions?

This is what I'm currently doing, but need another method.

$myfile = $sortedarray[$input];
$mypath = '\\\\tlrntfs1\\IT_Common\\output\\';
$myprogram = '"C:\\Windows\\notepad.exe"';
$mycommand = $myprogram.' "'.$mypath.$myfile ;
system($mycommand);

If you can put the html tag <PRE> at the start of the text file and </PRE>
at the end of the file then you can start a browser to display the data. I
will leave the Perl code to you.


Kevin Sproule
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,202
Messages
2,571,057
Members
47,667
Latest member
DaniloB294

Latest Threads

Top