FIND YOUR NEXT FEW LINES

Results for “fold”

Small, practical examples. Search by task or narrow things down below.

668 snippets foundClear filters
Linux CommandsFinding & selecting files

Extract a filename from a path

Linux Commands: Use basename with an explicit suffix when removing a known extension.

Linux Commands✓ Tested
SQLiteJSON data

Extract a JSON field

Read a scalar value from JSON text.

json_extract✓ Tested
Bash ScriptsParameter expansion

Extract a parent path with parameter expansion

Bash Scripts: Percent removes the shortest matching slash-and-suffix portion.

Bash Scripts✓ Tested
GoHTTP & URLs

Extract a route path variable

Extract a route path variable using a complete Go program with explicit sample inputs.

Go✓ Tested
Bash ScriptsParameter expansion

Extract a substring by offset and length

Bash Scripts: Bash substring offsets start at zero for an ordinary string.

Bash Scripts✓ Tested
GoStrings & text

Extract digit sequences

Extract digit sequences using a complete Go program with explicit sample inputs.

Go✓ Tested
PythonFile operations & archives

Extract filename components

Python: Use pathlib properties to separate a directory, filename stem, and suffix.

Python✓ Tested
SQLiteQueries & text

Extract part of a string

Use one-based positions with substr.

substr✓ Tested
SQLiteGetting Started

Filter by a numeric comparison

SQLite: Keep rows whose quantity exceeds a chosen threshold.

SQLite✓ Tested
SQLiteGetting Started

Filter groups after aggregation

SQLite: Use HAVING to test a group’s calculated total.

SQLite✓ Tested
Linux CommandsGetting Started

Filter lines by literal text

Linux Commands: Filter lines by literal text using GNU/Linux commands in an empty practice directory.

Linux Commands✓ Tested
SQLiteReporting & grouped calculations

Filter rows before grouping

SQLite: WHERE limits the rows contributing to the aggregate; it differs from filtering completed groups with HAVING.

SQLite✓ Tested