Converting Multiple Files

Converting Multiple Files

Post by David Smit » Sun, 16 Jul 1995 04:00:00



I have a large number of Pict files that I wish to convert to ppm under Linux
and am using picttoppm on a single file basis but would like to be able to
issue one command to convert the files all in one go

ie. a command of the form

picttoppm *.pict > *.ppm

but this is not a valid command line is not expanded to the form

picttoppm file1.pict > file1.ppm
picttoppm file2.pict > file2.ppm
etc.

can this job be acomplised with a shell script or a C program or by any
other technique under Linux?

I eventually want to convert the files to Jpeg but have not found a program
that can go straight from pict to Jpeg.

=---------------------------------.-----------------------------------------=
|       -  David  Smith  -        | Sound & Vision BBS [+44] (0)1932 252323 |

=---------------------------------.-----------------------------------------=

 
 
 

Converting Multiple Files

Post by James A. Robins » Mon, 17 Jul 1995 04:00:00



Quote:>I have a large number of Pict files that I wish to convert to ppm under Linux
>and am using picttoppm on a single file basis but would like to be able to
>issue one command to convert the files all in one go

You would be better off asking things like this in a general unix
forum.  To answer your question, yes you can do this by making a
mini-script at the prompt:

If you are using bash, or sh (ksh?):

        $ for i in *.pict
        > do
        > pictoppm $i > `echo $i|sed -e 's/pict/ppm/'`
        > done

If your using tcsh or csh:

        > foreach i (*.pict)
        foreach? picttoppm $i > `echo $i|sed -e 's/pict/ppm/'`
        foreach? end

There is probably an easier way to do the pict->ppm extension
conversion, but this works. :)

Quote:>I eventually want to convert the files to Jpeg but have not found a program
>that can go straight from pict to Jpeg.

Hmm, take a look at ImageMagick (it is on sunsite.unc.edu).

Jim
--
http://plato.simons-rock.edu/~jimr/

 
 
 

Converting Multiple Files

Post by Bill Nottingh » Mon, 17 Jul 1995 04:00:00


David Smith said:
: picttoppm *.pict > *.ppm
:
: but this is not a valid command line is not expanded to the form
:
: picttoppm file1.pict > file1.ppm
: picttoppm file2.pict > file2.ppm
: etc.
:
: can this job be acomplised with a shell script or a C program or by any
: other technique under Linux?

Something along the lines of

ls *.pict | cut -f 1 -d "." | xargs -n1 bob.sh

where bob.sh is:
picttoppm $1.pict > $1.jpg

(This is totally off the top of my head, and most likely needs a little
tweaking/refining)

: I eventually want to convert the files to Jpeg but have not found a program
: that can go straight from pict to Jpeg.

I could have sworn that I saw somewhere that Image Alchemy was ported
to UNIX... if it is, it should do it.  (I know the DOS version
can convert most anything to most anything else...)

Bill
--

 
 
 

1. Using dd to convert ASCII to EBCDIC and output the converted format to multiple tapes

Hi,

   I need to come up with a shell script that does the following:

1) convert ASCII to EBCDIC format
2) output the converted format to be able to span across multiple
tapes with logical labelling for the tapes (eg. i can label the tape
as A1,subsequent will be A2,A3 ....)

I am able to convert the data from ASCII to EBCDIC using the dd
command but i can't think of any methods to write the data to tape. If
i was to use tar, then the tape format will be in tar format and not
EBCDIC.

Any suggestions or methods worth trying is greatly appreciated. Thanks
in advance.

Alec

2. How to print to PC printer from Unix Dial-in?

3. Solution: multiple Apache log files, multiple args to env=, multiple conditions to CustomLog directive

4. Lernal Panic need help

5. how do i concatenate multiple files then split them into multiple files

6. arplookup failed message

7. To convert...and convert...and convert again

8. Power-save in textmode??

9. where are files to convert ez files to ps files for printing?

10. converting host file to named database files

11. portable way to convert FILE ptr to file descriptor?

12. Is there a gas preprossesor to convert dos masm .asm files to gas .S files

13. Converting all ps files in current directory to epsi files