Back to main menu

## Mode: list

#### Syntax

`atomsk --list <listfile> [<formats>] [options]`

#### Description

In this mode, Atomsk will convert a list of files. This is of course convenient when one has a lot of files to convert, typically snapshots of a molecular dynamics run.

The file <listfile> should contain a list of files to convert. A quick and simple way to build such a file is to list files in a directory and use the redirection symbol ">". For instance:

`ls * > list.lst`

In addition the <listfile> has the following specifications:

- empty lines, and lines starting with # are ignored (this can be used to insert comments).
- a line containing a file name will trigger the conversion of that file in all formats that are active. If the file is not found, a warning is displayed and Atomsk goes on with the following files.
- a line containing the statement `all <format>` activates this <format>.
- if a format is specified after a file name, the file will be converted to that format. This applies only to that file, not the following files.

As a result, the minimal `<listfile>` contains only one file name. A recommended, but not mandatory, extension for the `<listfile>`, is `.lst`.

The output format(s) can be activated in several ways (also check the list of supported formats):

- in the command-line, several output formats can be specified.
- in the `<listfile>` with the statement `all <format>`.
- in the `<listfile>`, after the name of each file, one <format> can be specified.

The output file names are automatically decided after the input file names and the active file format(s).

Note that you can use the mode `--list` in combination with one or several options. These options will then be applied to all the files converted.

#### Examples

- `atomsk --list filelist.lst cfg`

  This will convert all the files which names are specified in `filelist.lst` into the CFG format.

- `atomsk --list filelist.lst xyz cfg xsf`

  This will convert all the files which names are specified in `filelist.lst`, into XYZ, CFG and XSF formats.

- `ls *lmc >list.lst && atomsk -L list.lst xyz cfg`

  This will list all LAMMPS custom files (LMC) in the current directory, and convert them to XYZ and CFG formats.

Back to main menu