Click here to get back home

Newbie wants a simple script in perl

 HomeNewsGroups | Search | About
 comp.lang.perl.misc    Post an article   get this group's latest topics as an RSS feed add this group's latest topics to your My MSN content add this group's latest topics to your My Yahoo content
Subject Author Date
Newbie wants a simple script in perl 2007 04-05-2008
Posted by 2007 on April 5, 2008, 3:41 pm
Please log in for more thread options
Hi

I have a file called "list1" - its got about 80 rows - each row is
alpha numeric name w/ ".txt" extension - each name refers to a file in
the dir.

The script reads the list - for each name in the list, it will perform
an operation (an executable of a "C-program" and writes to same name
with a different extension, say ".mp3".

Thanks

Posted by Rui Maciel on April 5, 2008, 4:09 pm
Please log in for more thread options
On Sat, 05 Apr 2008 12:41:33 -0700, 2007 wrote:

> Hi
>
> I have a file called "list1" - its got about 80 rows - each row is alpha
> numeric name w/ ".txt" extension - each name refers to a file in the
> dir.
>
> The script reads the list - for each name in the list, it will perform
> an operation (an executable of a "C-program" and writes to same name
> with a different extension, say ".mp3".

Nice. What have you written so far? And why didn't you opted for bash?


Rui Maciel

Posted by 2007 on April 5, 2008, 6:22 pm
Please log in for more thread options
> On Sat, 05 Apr 2008 12:41:33 -0700, 2007 wrote:
> > Hi
>
> > I have a file called "list1" - its got about 80 rows - each row is alpha
> > numeric name w/ ".txt" extension - each name refers to a file in the
> > dir.
>
> > The script reads the list - for each name in the list, it will perform
> > an operation (an executable of a "C-program" and writes to same name
> > with a different extension, say ".mp3".
>
> Nice. What have you written so far? And why didn't you opted for bash?
>
> Rui Maciel

I changed it to bash but the code didn't work

THis is what I really need:
In a summary:
1) say about 80 files (but varies) in a dir with filenameX.txt
extension.

2) CONV1 runs one at a time and gives output w/ a fixed name, CONV.out

3) CONV2 takes CONV.out as well as the final output file (which is
filenameX.mp3). Ideally it puts them in a specified directly.

I really appreciate your help - I want something that works - I
started off with t shell - I am open to change to bash or perl. I
prefer a simpler looking program

Posted by Rui Maciel on April 5, 2008, 7:52 pm
Please log in for more thread options
On Sat, 05 Apr 2008 15:48:16 -0700, Andrew DeFaria wrote:

> Based on your sketchy requirements I'd say (in bash):
>
> $ cat list1 | while read filename; do
> > CONV1 $filename
> > CONV2 CONV.out
> > done
>
> Am I missing something?

Yes, he was trying to get someone to do his work. He obviously never even
gave it a try, not in perl and obviously not in bash. After all, it's one
of the recurring examples in each and every bash tutorial on the web.


Rui Maciel

Posted by Jürgen Exner on April 5, 2008, 6:24 pm
Please log in for more thread options
>I have a file called "list1" - its got about 80 rows - each row is
>alpha numeric name w/ ".txt" extension - each name refers to a file in
>the dir.
>
>The script reads the list - for each name in the list, it will perform
>an operation (an executable of a "C-program" and writes to same name
>with a different extension, say ".mp3".

Ok.
What is your question (if you got any) or the point of your posting?

jue

Similar ThreadsPosted
How to call a simple perl script from HTML without need of HTTPS but simple HTTP ? May 11, 2006, 4:37 am
Need help with a simple (I think) Perl script May 28, 2008, 11:01 pm
NEWBIE: Perl CGI script that redirects to another webpage January 5, 2005, 12:40 am
[Newbie] Running a Perl script on Windows October 8, 2005, 8:48 pm
Newbie...Not able to include a file in perl script February 19, 2007, 10:43 pm
[newbie] XML::Simple install fails? June 4, 2007, 7:54 am
Can someone write me a simple Perl script for a few bucks? February 3, 2006, 11:20 pm
Improving performance of a simple Perl script July 28, 2006, 5:20 pm
launch simple perl script from browser January 15, 2007, 6:35 pm
Newbie with simple File handling problem November 14, 2006, 12:52 pm

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap