FIND YOUR NEXT FEW LINES

Results for “Text cleanup & matching”

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

509 snippets foundClear filters
SQLText cleanup & matching

Treat an empty trimmed value as missing

SQL: NULLIF converts an empty string to NULL before a fallback is applied.

SQL✓ Tested
SQL ServerText cleanup & matching

Treat an empty trimmed value as missing

SQL Server: NULLIF converts an empty string to NULL before a fallback is applied.

SQL Server✓ Tested
PostgresText cleanup & matching

Treat an empty trimmed value as missing

Postgres: NULLIF converts an empty string to NULL before a fallback is applied.

Postgres✓ Tested
SQLiteText cleanup & matching

Treat an empty trimmed value as missing

SQLite: NULLIF converts an empty string to NULL before a fallback is applied.

SQLite✓ Tested
PostgresWindows & text

Replace all matching text

Normalize repeated whitespace with a regular expression.

regexp_replace✓ Tested
PythonFunctions & error handling

Run cleanup around a custom context

Python: Use try/finally inside a contextmanager so cleanup runs even on failure.

Python✓ Tested
Linux CommandsSearching text

Count matching lines

Linux Commands: Use grep -c to count matching lines rather than individual occurrences.

Linux Commands✓ Tested
Linux CommandsSearching text

Exclude matching lines

Linux Commands: Use grep -v to retain lines that do not start with a comment marker.

Linux Commands✓ Tested
Linux CommandsSearching text

Print only the matching portions

Linux Commands: Use extended regex and -o to extract digit sequences.

Linux Commands✓ Tested
C#Files & paths

List matching files

Enumerate immediate text files and sort their names in C#.

C#✓ Tested
Linux CommandsText processing

Search for text in a file

Find matching lines with their line numbers, ignoring letter case and treating the pattern as literal text.

grep✓ Tested
HTMLGetting Started

Accept several lines of text

HTML: Learn how to accept several lines of text in a complete browser example.

HTML✓ Tested