comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » concatenating files
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
concatenating files [message #2906] Thu, 13 October 1994 06:00 Go to next message
darren is currently offline  darren
Messages: 5
Registered: March 1994
Junior Member
Hi All, Does anyone know an easy way to concatenate several
files (WAVE programs and functions) into one big file, so that it can
all be compiled with a single ".run" command?
Thanks. -Darren Orbach
Re: concatenating files [message #2988 is a reply to message #2906] Fri, 14 October 1994 04:44 Go to previous messageGo to next message
hahn is currently offline  hahn
Messages: 108
Registered: November 1993
Senior Member
In article <37jhs1$gq4@paperboy.gsfc.nasa.gov> thompson@orpheus.gsfc.nasa.gov (William Thompson) writes:

... lines deleted ...

> You don't say which operating system you're using, but in Unix one would
> simply say

> cat *.pro > bigfile.PRO ;Concatenate
> mv bigfile.PRO bigfile.pro ;Rename

... remainder deleted ....

disk storage seems to be cheap!

Why not put to following compile comands into one control file, which would
then look like
.run sub1
.run sub2
...
.run last

and execute with @control file

The @ command works on every system.

Norbert Hahn
RE: concatenating files [message #2993 is a reply to message #2906] Thu, 13 October 1994 11:17 Go to previous messageGo to next message
mallozzi is currently offline  mallozzi
Messages: 60
Registered: August 1994
Member
| darren@rockvax.rockefeller.edu writes:
| Does anyone know an easy way to concatenate several
| files (WAVE programs and functions) into one big file, so that it can
| all be compiled with a single ".run" command?

I somtimes use the following for IDL on a VAX, but I guess it should work
on other platforms as well:

Create a file that looks like
.run PRO1
.run PRO2
.run FUNCTION1
.run PRO3
MAIN_PRO

where the last line is an IDL call to MAIN_PRO, where MAIN_PRO is your main
code (that you made into a procedure) that calls PRO1, PRO2, etc

Then define an operating system symbol, that for VAX would look like
RUNNIT == "$IDL_DEV:[IDL_DIR]IDL MY_DEV:[MY_DIR]MY_FILE"

Typing RUNNIT at the DCL prompt invokes IDL, compiles PRO1, PRO2, etc
and begins executing MAIN_PRO

Does that help?
mallozzi@ssl.msfc.nasa.gov
RE: concatenating files [message #3049 is a reply to message #2993] Wed, 19 October 1994 09:40 Go to previous message
landers is currently offline  landers
Messages: 45
Registered: May 1993
Member
In article <37jtjt$lfr@hammer.msfc.nasa.gov>, mallozzi@ssl.msfc.nasa.gov writes:
|> | darren@rockvax.rockefeller.edu writes:
|> | Does anyone know an easy way to concatenate several
|> | files (WAVE programs and functions) into one big file, so that it can
|> | all be compiled with a single ".run" command?
|>
|> I somtimes use the following for IDL on a VAX, but I guess it should work
|> on other platforms as well:
|>
|> Create a file that looks like
|> .run PRO1
|> .run PRO2

[...snip]

Here's a program I use in PV-WAVE to compile an entire directory full of
stuff. This .RUNs each file, and executes COMPILE to save a *.cpr file.
It's done for each *.pro file in the current directory.

It also makes a file named compileall.com that has all the compile
instructions in it (so next time, you just need to run that).

For all you poor IDLers, you can probably modify it (take out the COMPILE) and
use it to generate the compileall.com file.

To use it, just CD to the directory with your programs, and do:
@make.com
(assuming make.com is in the !Path)

------ make.com -------- snip here ------
; make.com
; Run this by CD'ing to the directory you're compiling and then type:
; @<whatever-path-needed>/make.com

; This will generate and execute a compileall.com to .RUN & COMPIILE
; all the .pro's in the current directory.

; ***WARNING*** This will DELPROC,/All and DELFUNC,/All - deleting any
; programs that are currently compiled.
; Also, it makes a file named compileall.com in the current dir.

; Procedure:
; loop thru the files, strip off the '.pro', run them, and compile them:
; Delete all functions and procedures between each so we can get all
; the needed subroutines with the /All keyword.
; Note that everything is .RUN'ed twice - this is to support recursion
; in functions that are embeded in files with a different name as the
; routine

save_quiet = !Quiet
!Quiet = 0 ; turn on .RUN noise, so we can watch it go....

; get all the .pro files

files = FINDFILE( '*.pro', Count=count )

; build a compileall.com program to compile everything in this directory

OPENW, lun, /Get_Lun, 'compileall.com'

FOR i = 0L, count-1 DO BEGIN $
file = STRMID( files(i), 0, STRLEN( files(i) ) - 4 ) &$
PRINTF, lun, 'DELPROC,/All' &$
PRINTF, lun, 'DELFUNC,/All' &$
PRINTF, lun, '.RUN ' + file &$
PRINTF, lun, '.RUN ' + file &$
PRINTF, lun, 'COMPILE,/All, file="' + file + '"'
;ENDIF

PRINTF, lun, 'DELPROC,/All'
PRINTF, lun, 'DELFUNC,/All'

FREE_LUN, Lun

; Now run the file to compile everything

@compileall.com

!Quiet = save_quiet ; back to user's normal

; Get rid of internal variables

DELVAR, save_quiet, files, count, Lun, file

;END
----- make.com ---- END

Dave

PS - Sorry if this gets posted twice (or more), but my NNTP host is
having anxiety attacks....
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: CALL_EXTERNAL and VAX/VMS
Next Topic: Style guide for programming in PV-WAVE

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 19:56:42 PDT 2025

Total time taken to generate the page: 0.15346 seconds