Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > Perl Misc > file name in perl script?

Reply
Thread Tools

file name in perl script?

 
 
Nico
Guest
Posts: n/a
 
      03-09-2005
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 ;
--
where to give the name "editme.txt" ?
so the script can make the changes in the txt file..?
Please advice
Nico
 
Reply With Quote
 
 
 
 
danfperl@yahoo.com
Guest
Posts: n/a
 
      03-09-2005
Try something like this:

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

 
Reply With Quote
 
 
 
 
Tad McClellan
Guest
Posts: n/a
 
      03-09-2005
http://www.velocityreviews.com/forums/(E-Mail Removed) <(E-Mail Removed)> wrote:


> $path = 'c:\editme.txt' ;



Or,

$path = 'c:/editme.txt';

You are not required to use silly slashes in paths.


--
Tad McClellan SGML consulting
(E-Mail Removed) Perl programming
Fort Worth, Texas
 
Reply With Quote
 
Tad McClellan
Guest
Posts: n/a
 
      03-09-2005
Nico <(E-Mail Removed)> wrote:

> Someone created some pl files for me.



> where to give the name "editme.txt" ?



Ask the Someone who wrote the program.


--
Tad McClellan SGML consulting
(E-Mail Removed) Perl programming
Fort Worth, Texas
 
Reply With Quote
 
Martin Kissner
Guest
Posts: n/a
 
      03-09-2005
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

--
perl -e '$|=1;&p(7.74.117.115.116.32);&s();&p(97.110.111); &p(116.104.101
..114);&s;&p(32.112.101.114.10;&s();&p(32.104.97 .99.107.101.114.10);sub
s{sleep 1};sub p(){print "@_"}'
 
Reply With Quote
 
Nico
Guest
Posts: n/a
 
      03-10-2005
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





Martin Kissner <(E-Mail Removed)> wrote in message news:<(E-Mail Removed)>...
> 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

 
Reply With Quote
 
Martin Kissner
Guest
Posts: n/a
 
      03-10-2005
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

--
perl -e '$|=1;&p(7.74.117.115.116.32);&s();&p(97.110.111); &p(116.104.101
..114);&s;&p(32.112.101.114.10;&s();&p(32.104.97 .99.107.101.114.10);sub
s{sleep 1};sub p(){print "@_"}'
 
Reply With Quote
 
Nico
Guest
Posts: n/a
 
      03-10-2005
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


Martin Kissner <(E-Mail Removed)> wrote in message news:<(E-Mail Removed)>...
> 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

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
adding a variable name to a hash to name is part of the variable name Bobby Chamness Perl 2 04-22-2007 09:54 PM
print("my name is {name}, and {age}-year old {gender}", name, age, gender); =?iso-8859-1?B?bW9vcJk=?= Java 7 01-02-2006 04:39 PM
IE name="name" & form.name property bug Java script Dude Javascript 5 06-30-2004 03:07 AM
name = name.substring(0, name.lastIndexOf('.')); Help please Jack-2 Javascript 3 12-24-2003 04:39 PM
Re: Urgent! how to get object name, method name and attribute name based on the strings? ding feng C++ 2 06-25-2003 01:18 PM



Advertisments