Using a Redirection File on the GDSFILT Command Line

One of our customers wanted to use GDSFILT to merge 1000 small files into a single large one. This cannot be done by listing each of the files on the command line -- after a dozen or so file names the command line gets too long for the program to parse.

The way to deal with this is to use a redirection file. This is a text file that contains each argument of the command line on a separate line. It appears on the command line preceded by the @ symbol which tells the command interpreter to read the contents of the file.

For example, consider the following gdsfilt command line where we merge 4 files together. (The command line has been broken into multiple lines for readability, but in real usage it would be all one long line.)

../bin/gdsfilt                                 <-- gdsfilt executable
  demo1.gds                                    <-- first input file
    demo1_merge.gds                            <-- output file
      TOPMOSTST                                <-- top level structure of input file
        -max:65536                             <-- max cells 
          -merge                               <-- merge argument
            /home/examples/demo2.gds           <-- file to add (merge) 
            /home/examples/demo5.gds           <-- file to add (merge)
            /home/examples/demo3.gds           <-- file to add (merge)

You can see that if we had to merge 1000 files the command line would be much too long for gdsfilt to process.

The Redirection File

A redirection file is a simple text file that has each argument on its own line. There is no limit to how many lines can be placed into this file so merging 1000 files is not a problem. Here is what the redirect file should look like for this example.

New Command Line

../bin/gdsfilt @merge_list

New Redirection File: merge_list