Skip to documentation
DocumentationAll documentsEnglish

DSEL(1)

NAME

dsel - selectively keep or skip doubles from a data stream

On this page

SYNOPSIS

dsel _keep_ < input.doubles > output.doubles
dsel _skip_ _keep_ [_skip_ _keep_ ...] < input.doubles > output.doubles

DESCRIPTION

dsel reads a stream of double-precision floating-point numbers from standard input, selectively copies or discards runs of values according to its positional arguments, and writes the kept values to standard output. Both input and output must be redirected; dsel refuses to run if either standard input or standard output is a terminal.

If a single argument is given, dsel copies exactly that many keep values to the output and exits.

With two or more arguments, they are interpreted as alternating skip and keep counts: dsel reads and discards skip values, then reads and copies keep values, repeating for each pair. If the argument list ends with an unpaired skip (an odd argument count greater than one), the final implied keep is treated as infinite, so all remaining values are copied. A skip count of zero or less is ignored, while a keep count of zero or less causes dsel to stop. If the stream ends before a requested count is satisfied, dsel stops at end-of-input.

This is the double-precision counterpart of the byte- and short-oriented stream selectors used throughout the BRL-CAD signal-processing tools, and pairs well with dconv(1), dmod(1), and dstats(1).

OPTIONS

-h, -?

Print a usage message and exit.

skip

Number of double-precision values to read and discard.

keep

Number of double-precision values to read and copy to the output.

EXAMPLES

Example 1. Extract a window of samples
dsel 512 1024 < data.d > window.d

Skips the first 512 doubles of data.d (for example, a header or settling region) and copies the next 1024 doubles to window.d, ignoring the rest.

Example 2. Take a leading block and scale it inline
dsel 1024 < signal.d | dmod -m 2.0 > head_scaled.d

Copies only the first 1024 doubles of signal.d (a single argument is always a keep count), then pipes them through dmod(1) to scale each value by 2.0 before writing head_scaled.d.

SEE ALSO

brlcad(1), dconv(1), dmod(1), dstats(1), dpeak(1), d-f(1), f-d(1)

AUTHOR

BRL-CAD Team

This software is Copyright (c) 1989-2026 by the United States Government as represented by U.S. Army Research Laboratory.

BUG REPORTS

Reports of bugs or problems should be submitted via electronic mail to devs@brlcad.org