'List species' examples

Command Purpose
lsp wateq4f.dat outputs a summary of the major PHREEQC database-related keywords found in the file wateq4f.dat in the current directory
lsp -s wateq4f.dat as above but includes a list of all species
lsp -d wateq4f.dat as above but appends details including key parameter values (e.g. log_k's)
lsp -l wateq4f.dat as above but appends line numbers and analytical expressions
lsp -e -t wateq4f.dat as above but appends the defining equations and tidies them up
lsp -s -b=4,5 wateq4f.dat outputs all the PHASES (solids and gases) in wateq4f.dat
lsp -r -s "*.dat" >lsp.out recursively outputs a list of all species in all *.dat files in the current directory and all sub-directories and sends results to lsp.out
lsp -r -p -s -f="U:*" "*" recursively finds all U species in all files (set filter)
lsp -d -f="U.*CO3" "*.dat" outputs details for all U-CO3 species in .dat files (regex filter)
lsp -d -p -f="C[^a-z],C$" "*.dat" outputs details for all carbon species in .dat files (regex filter)
lsp -s -f="C:S:*" "*.dat" outputs details for all species containing carbon OR sulfur (set filter)
lsp -s -f="C:S:*" "*.dat" outputs details for all species containing carbon AND sulfur (set filter)
lsp -s -f="C:S" "*.dat" outputs details for all species containing ONLY carbon or sulfur (set filter)
lsp -s -f="C,S" "*.dat" outputs details for all species containing letter C or letter S (regex filter)
lsp -r -s -x="\.pqo$ \.doc$" "*" analyse all files in the current directory and sub-directories excluding all files with extensions .pqo and .doc
lsp -d -c new.dat old.dat compare line-by-line after reducing both files to lsp -d format. Then send the output to 'WinMerge' if found else 'fc' or if set, an explicit -c="<app>"
lsp -c="diff" -co="-wB -C 0" -o "new.dat old.dat" compare new.dat and old.dat in their original formats using the 'diff' program. Ignore white space and blank lines; output no extra context lines
lsp -f="Alkalinity:H:O:E:Na:K:Mg:Ca:Cl:C:S:N" -f2 llnl.dat makes a filtered llnl.dat database file containing just the major element species
lsp -f2 -k="asis" -ts llnl.dat tidies llnl.dat with no sorting, filtering etc. and retains comments in order. Add -e to only reformat the species equations.
lsp -f3 -e -t wateq4f.dat makes a comma-separated spreadsheet format file with trimmed equations. The location is: .lsp.csv, where filename is, e.g., wateq4f.dat
lsp -f help for option f
lsp -h | more full help with paging

List species (lsp)

Purpose

The list species app (lsp) is a small command line program ('app') for locating and analysing PHREEQC-format database files. It helps to count and view the species defined within a file at several levels of detail. It also has a file comparison mode for locating small differences between two database files. It can also prepare new database files after selective filtering, and if wanted, tidying.

Download and Installation

The app is available for x64 Windows and Linux (Ubuntu, Debian, ArchLinux, FedoraLinux, openSUSE) New!. The Linux version requires at least GCC 11.4.

Windows

To install, download and run one of the two Windows installers. These are: (i) a 'per user' version that does not need admin rights and will by default install to the users directory, e.g. C:\Users\xxxxx\AppData\Local\lsp\ where xxxxx is the user name. Other users will not have access to this, or (ii) an 'all users' version that will install by default to C:\Program Files\lsp\ and will be visible to all users. This requires admin permission. In both cases, it is possible to change the installation directory during installation. Installation will create the following sub-directories: \bin (binaries), \doc (documents) and \db (databases). \bin contains lsp.exe and various helper apps. Options will be given to add the \bin directory to your path, and to download the WinMerge app to provide a viewer for file comparisons (both recommended). \db contains the standard PHREEQC databases in a UTF-8 compatible format.

Linux

Create an lsp directory and download the tar file into it. Untar the file (tar -xzvf lsp-linux-xxxx-xx-xx.tar.gz), and then run the install script, ./install.sh, to download any missing apps and to copy the lsp binary to your home/xxxx/.local/ directory. It also adds this to your path. Then re-login to activate these changes. The file structure is similar to Windows except that instead of WinMerge, meld is the default file viewer.

Licenses

A full list of the applicable licenses and their conditions can be found here and in the doc directory.

Running

To run, open a command line (console or terminal) window and type

>lsp -h

where h (for 'help') is an option. This should give a list of all the options and can be viewed here. -h1 provides a one-line summary of the options. A list of examples is given in the right panel. Individual help information is available via lsp -<option>, e.g. lsp -f for the filter option.

All output is to the screen. Output to a file can be made using redirection by adding '> <filename>' to the end of the command where <filename> is the name of the file to receive the output.

Changes

A list of changes can be seen here and in the changes.txt file in the doc directory.

Updates

The app will be periodically updated so it is worth checking if you have the latest version by comparing your version's date in the lsp version info (-v) banner with the 'Last updated' date below. Bug reporting, suggestions and queries to david@phreeplot.org.

Up    Home

Last updated: 15 May 2026