Re: simple perl script on Windows

2007-01-19 Thread Dr.Ruud
David Moreno Garza schreef: > open FILE, 'H:\My Music\folderlist.txt'; > open DEST, '> H:\My Music\artists.txt'; > foreach my $line(readline FILE) { > chomp; > print DEST $1."\n" if $line =~ /\s*(.*)$/; > } > close FILE; > close DEST; Wouldn't it be great if, especially on this list, such

Re: simple perl script on Windows

2007-01-18 Thread David Moreno Garza
On Thu, 2007-01-18 at 21:42 -0500, Mathew Snyder wrote: > Citlali had provided a regex that almost did what I wanted and then David gave > me one that did exactly what I wanted. Yay! We learn from everybody :-) David. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail

Re: simple perl script on Windows

2007-01-18 Thread Mathew Snyder
Rob Dixon wrote: > Mathew Snyder wrote: >> Rob Dixon wrote: >>> Mathew wrote: I have a file with a list of subfolders. The list was created using dir and each entry is like thus: 12/12/2005 04:38 AM A Perfect Circle I then created a simple script th

Re: simple perl script on Windows

2007-01-18 Thread Rob Dixon
Mathew Snyder wrote: Rob Dixon wrote: Mathew wrote: I have a file with a list of subfolders. The list was created using dir and each entry is like thus: 12/12/2005 04:38 AM A Perfect Circle I then created a simple script that I hoped would eliminate everything prior to the last

Re: simple perl script on Windows

2007-01-18 Thread Mathew Snyder
Rob Dixon wrote: > Mathew wrote: >> I have a file with a list of subfolders. The list was created using dir >> and each entry is like thus: >> >> 12/12/2005 04:38 AM A Perfect Circle >> >> I then created a simple script that I hoped would eliminate everything >> prior to the last bit

Re: simple perl script on Windows

2007-01-18 Thread Rob Dixon
Mathew wrote: I have a file with a list of subfolders. The list was created using dir and each entry is like thus: 12/12/2005 04:38 AM A Perfect Circle I then created a simple script that I hoped would eliminate everything prior to the last bit of text which follows the big space

Re: simple perl script on Windows

2007-01-18 Thread David Moreno Garza
On Thu, 2007-01-18 at 11:44 -0500, Mathew wrote: > open FILE, "H:\My Music\folderlist.txt"; > > foreach my $line (readline FILE) { > $line =~ s/^.*\s//g; > open FILE2, "H:\My Music\artists.txt"; > print FILE2 $line . "\n"; > close FILE2; > } > > close FILE; I'd go w

Re: simple perl script on Windows

2007-01-18 Thread Tom Phoenix
On 1/18/07, Mathew <[EMAIL PROTECTED]> wrote: open FILE, "H:\My Music\folderlist.txt"; Use forward slashes instead of backslashes in filename strings, even on Windows. (Or, if you mean a true backslash, use two of them; a single backslash is always magical in Perl.) And check the return value

Re: simple perl script on Windows

2007-01-18 Thread I . B .
also keep open and close outside the loop. you overwriting previously written lines. open FILE2,"$file"; foreach @lines { print FILE2 $_; } close FILE2 cheers On 1/18/07, Mathew <[EMAIL PROTECTED]> wrote: Thanks. That likely will help. However, I still can't even get it to perform any action

Re: simple perl script on Windows

2007-01-18 Thread Mathew
Thanks. That likely will help. However, I still can't even get it to perform any action. I have it set to print to the screen right now but it isn't creating any output. Mathew Guerrero, Citlali (GE, Corporate, consultant) wrote: > Hi Mathew : > > This is what your regexp ($line =~ s/^.*\

simple perl script on Windows

2007-01-18 Thread Mathew
I have a file with a list of subfolders. The list was created using dir and each entry is like thus: 12/12/2005 04:38 AM A Perfect Circle I then created a simple script that I hoped would eliminate everything prior to the last bit of text which follows the big space. open FILE, "H