file name in perl script?

N

Nico

Hi, I'm a bit of newby.
Someone created some pl files for me.
I have them on my pc in de dir: c:/perl
The script must do some editting
When I start a pl file, a black box appaers, (c:\perl\bin\perl.exe)
The pl-file must start some editting in a file called: editme.txt
Here are the first line of the pl-script

#!c:\perl\bin\perl!
#
# EI2.pl - 1st pass to prepare for conversion dbtext
# indonesica database to MY format
# Piet J, 2/5/2005
#

$onder = 0 ;
$boven = 100000 ;
 
D

danfperl

Try something like this:

$path = 'c:\editme.txt' ;
open ( EDITME, ">>$path" ) or die "no such file" ;
# Write to it.
close EDITME ;
 
M

Martin Kissner

Nico wrote :
Here are the first line of the pl-script

#!c:\perl\bin\perl!
#
# EI2.pl - 1st pass to prepare for conversion dbtext
# indonesica database to MY format
# Piet J, 2/5/2005
#

$onder = 0 ;
$boven = 100000 ;

where to give the name "editme.txt" ?
so the script can make the changes in the txt file..?
Please advice

This question can not be answerded if only the first few lines of code
are presented.
Best thing would be to ask the author of the script.

It could be, that you are supposed to pass the filename on the command
line like this
EI2.pl c:/path/editme.txt
But this is only a wild guess and I would not dare to try without a
backup of "editme.txt" if I didn't understand what the script really
does with "editme.txt".

Best regards
Martin
 
N

Nico

Hi Martin,
Thanks for you advice, I can now see the script working and making the
changes,however, I can not find the result?
I think there must be another command to put the result in a output
directory?
EI2.pl c:/path/editme.txt ..?
I tried this in the script, "$outputdir='output';",but it did not
work.
I guess that I must type something at the command line.

The creator of the scripts can not be found, otherwise...


Thanks in advance,
Nico
 
M

Martin Kissner

Nico wrote :

Please read http://learn.to/quote to learn how to properly quote in
usenet. - Thank you.
Hi Martin,
Thanks for you advice, I can now see the script working and making the
changes,however, I can not find the result?
I think there must be another command to put the result in a output
directory?
EI2.pl c:/path/editme.txt ..?
I tried this in the script, "$outputdir='output';",but it did not
work.

I think it's a waste of time and effort to add code you do not
understand (or somthing that looks like code) to a script which you do
not understand.
It's like soldering some cables into a TV which does not show the
desired program, without any clues of electronics.
I guess that I must type something at the command line.

This might be or might not be true.
If you see the results in the commandline window try

EI2.pl c:/path/editme.txt > c:/path/result.txt

This is how it would work on Unix then; I have no idea if this works on
windows, since I do not use it.
The creator of the scripts can not be found, otherwise...
?

Best regards
Martin
 
N

Nico

Hello Martin,
Thanks again for your advice, it worked!
It's like an old Dos command.
I know what the script is doing, its converting records from a
database format to an other database format. The script has 565 lines,
that's why I only send the first lines, I knew that I only needed to
know how to start the script, and were to put the results, I did not
found the answers in handbooks...
This line: "$outputdir='output';", was a suggestion from an other on
this list.
I apologize for my poor English.

Best regards,
Nico
 

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
473,774
Messages
2,569,599
Members
45,175
Latest member
Vinay Kumar_ Nevatia
Top