OK, I know my subject is not the best, but I couldn't think of anything
better. Here is my situation:
There is a website that allows you to search a database by Name or Number.
Once you search by name it will provide all kinds of information
(including dates) for the search parameters. I want t
I have a file I download everyday, let's call it "output.txt." The file
"output.txt" is saved in a directory by date, for example 10012005 (for Oct.
1, 2005). I have a years worth of output files in my c:\ drive. Now I have
to rename each output file so that I can copy all of the output to a sin
<>
>> So I suppose I want to do a locate, rename, move. 1) locate all
>> "output.txt" files on the hard drive; 2) rename each "output.txt" to
>> something unique, and 3) move each renamed file from its original
>> location
>> to a single directory.
>>
>> I have tried a few ways with no success.
<>
>>
>> So I suppose I want to do a locate, rename, move. 1) locate all
>> "output.txt" files on the hard drive; 2) rename each "output.txt" to
>> something unique, and 3) move each renamed file from its original
>> location
>> to a single directory.
>>
>> I have tried a few ways with no succes
Basically the script runs and looks for a file in a certain directory. If
the file is there, the script continues to run and process the file, but
if the file is not there the script should just exit.
Any ideas on how to do this?
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional c
Here is my problem. I want to delete the files contained in a directory
from a list contained in a file. Here is an example:
The input file is a regular text file in the following format (call it
myfile.txt);
item1
item2
item3
item4
What I want to do is look in a directory and delete any
To all of you who helped me with my unlink problem...THANK YOU!!!
I finally figured out that the problem was the input file. There was an
extended ASCII character at the beginning of the file that could not be
seen until I looked at it with a hex editor.
I am learning the hard way. But now the
Now that I have, with all of you helping, dealt with the unlink problem.
I am now faced with a new problem.
I have a file, myfile.txt, that consists of various text items that are
repetitive. I am trying to replace many of the repetitive items with a
place holder. Here is an example of myfile.tx
In my zeal for making things simple I may have created a problem. OK,
here is the lowdown:
the real file names I am trying to delete from the directory are rather
lengthy and complicated and look like:
partial_qn_ri_pub_default_asp__Online_qdisp_bn_03042997-0-0
partial_qn_ri_pub_default_asp__Onl
I am still struggling through the problem I was having earlier. However,
I am a great deal further. I cannot seem to get unlink to delete the
files from the directory. I have made the script as simple as possible
and cannot get unlink to work.
unlink ("c:\testdir\*030977*.*") || die "unlink fai
> On Fri, 8 Aug 2003 22:16:38 -0400 (EDT), perlwannabe wrote:
>> I tried both the suggested methods without success. But, I mightuv
>> found a problem. I tried all of these methods with no success and
>> looked at the input file "listitems.txt" and found someth
Still having problem with unlink. My original problem began with deleting
files from a list. I seem to have fixed the problem reading the list but
the unlink does not work.
Here is the test script that I am working from:
my $file = 'listitems.txt';
open my $fh, $file or die "Cannot open $file:
>>
>> The directory c:/testdir/ contains many files, but I want to delete
>> the files with any *item###*.* from the directory. So if the
>> directory has 3000 files I want to delete every file that has item997
>> in it.
>>
>
> glob returns the relative path of the files so if you are in a
> diff
> Steve Grazzini wrote at Wed, 06 Aug 2003 23:38:00 -0400:
>
>> On Wed, Aug 06, 2003 at 11:49:20PM -0400, perlwannabe wrote:
>>> I have made the script as simple as possible and cannot get
>>> unlink to work.
>>>
>>> unlink ("c:\testdir\*030977
> This works - i've tried it...
>
> print 'Deleted ' , unlink (<*997*>) , ' files.\n';
>
> good luck
> Duncan
Yes, it does. But it does not work when reading from a variable.
my $temp = '*997*';
print 'Deleted ' , unlink (<$temp>) , ' files.\n';
This very simple variation of your example does n
There is a .pdf file on a website that I would like to download on a daily
basis. The site puts up a new .pdf file everyday and I would like to
write a simple script to download the file to my computer.
The URL basically adds the name of the file with the date, i.e.
http://www.samplesite.com/fil
I have a text file that is a mess. It contains various fields with lots
of spaces between the fields. The amount of spaces differs from field to
field. Here is a sample of the file:
<8sp>NAME:<13sp>JOHN
SMITH<22sp>RANK:<3sp>CAPTAIN<15sp>WIFE:<6sp>POCAHONTAS...
What I would like to have after p
lace all occurrences of "oldtext" with "newtext".
You should visit the perlfunc at perl.com to get all of the variables and
syntax of s///
HTH
Perlwannabe
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
OK, I have a new problem. I need to delete an entire line that contains
certain text. I have done an extensive search and had no luck finding an
adequate answer. Yes, I also saw the FAQ that just refers me to
Tie::file. The most promising solution was:
perl -ni.bak -e 'print unless /FOO/;' inp
I have a text file that has various addresses in different formats. I
need to remove any items that are not part of the address so the output is
standard. Here is an example of the input file:
Address:1234MockingbirdLaneCity:GrotonState:CT
Address:2933HummingbirdSt.City:GrotonState:CT
Address:43
>> I know it involves using the s/// operator to both strip the tabs and
>> replace with but the problem is that it requires using an array
>> for each address...and that is what is creating problems for me.
>
>
> s{ (?<=Address:\t) (.+?) (?=\tCity:) }
> { ( $a = $1 ) =~ tr/\t/ /; $a }ex;
> On Tuesday, September 9, 2003, at 08:58 PM, perlwannabe wrote:
>
>> I know it involves using the s/// operator to both strip the tabs and
>> replace with but the problem is that it requires using an array
>> for
>> each address...and that is what is creating
I posted a problem to the mailing list with a similar question I had some
time ago regarding replacing data between fields. Unfortunately, I am
having a difficult time with the problem. I am including the code and a
sample of the data. Could someone please give me a clue as to why this is
not wo
> Perlwannabe wrote:
>>
>> I posted a problem to the mailing list with a similar question I had
>> some time ago regarding replacing data between fields. Unfortunately,
>> I am having a difficult time with the problem. I am including the
>> code and a sample o
> Perlwannabe wrote:
>>
>> I originally tried to do this, but it won't work. The data doesn't
>> _always_ have a before address, sometimes (although seldom) it
>> has a . With grep I would miss the entire address. However,
>> if I were to just se
I have a relatively simple script that needs to get two separate dates,
today's date, and yesterday's date. The dates are in mmddyy format.
Everything works great on days 2 - 31 of the month, but on the first of
the month yesterday's date is not correct. For example, on October 1,
2003 the varia
Thank you for all of the responses to my date/time problem. I have
rewritten the routine with the information and feel confident it is far,
far better than what I had.
Thanks...
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
27 matches
Mail list logo