LANL Home  |  Phone
 

FILEMERGE

Merging dorgbn data files

 

[Script]

FILEMERGE allows manipulation of binary data files that are in the "dorgbn" format. You can extract one or more "columns" of data from a file, duplicate columns from a file, or combine parts of different files.

This routine is based on the UCLA program DORGBN. Data are stored in binary files in the form h,k,l,resolution,and columns of "data". At the beginning of the file are an overall title for the dataset and individual titles for each "data" column.

FILEMERGE runs interactively. The command format is:

1. # of Files to be opened for input (up to 4)

2a... Input file names 1...n.

3. Output file name

4. Title for output file. This title should describe the

contents of the entire file.

5. Command lines. Each command can specify a range of columns of data from some particular file to be incorporated into the output file. These data columns are incorporated in the order in which the commands are specified. Command input parameters: (these are 1 or 2 digit integers and an optional title, all separated by commas and no blanks):

1. NFILE: The number of the file treated.

2. ICOL,JCOL,TITLE: the RANGE of columns to be copied. If you want to copy just column #3, specify: 3,3 here.

The title is an optional title to be substituted for that already associated with the first column in the range. If the specified range includes more than one column and this title field is used, the titles for all the other columns in the range specified by this command must be input in the very next records. If this field is blank, the old title will be used.

PLEASE NOTE: if you are running filemerge from a command file, you cannot leave any blanks or other characters afer the column numbers here. That is,

3,3

is fine, but

3,3 !xxx

is not.

7. More command lines.

8. A "0" to signify the end of input.

An additional useful feature of the program is that if a command is entered with a valid file number but with the column numbers missing or incorrect, the titles of the columns on that file are printed for the user.

Script for FILEMERGE

Here is a sample script that will take columns 1,2 from "file1.drg" and columns 1 and 3 from "file2.drg" and write them out to "fileout.drg".

!----------------------Sample script for FILEMERGE --------------------------
FILEMERGE
2
file1.drg
file2.drg
fileout.drg
Title for fileout: cols 1,2 from file1 and cols 1,3 from file2
1
1,2
2
1,1
2
3,3
0
!------------------------------------------------------------------------------

Disclaimer

Operated by Los Alamos National Security, LLC for the U.S. Department of Energy's NNSA

Inside | © Copyright 2006 Los Alamos National Security, LLC All rights reserved | Disclaimer/Privacy | Web Contact