FIND YOUR NEXT FEW LINES

Results for “first lines”

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

185 snippets foundClear filters
Docker / ComposeGetting Started

Build an image with a default command

Docker / Compose: Build an image with a default command with a complete introductory Dockerfile.

Docker / Compose✓ Tested
CFiles

Count newline characters

Count newline bytes in a C file while retaining EOF as an int.

C✓ Tested
HTMLGetting Started

Create a complete HTML document

HTML: Learn how to create a complete HTML document in a complete browser example.

HTML✓ Tested
C#LINQ transformations

Find a matching item with a fallback

C#: Use the FirstOrDefault overload with an explicit default value.

C#✓ Tested
Bash ScriptsFunction scope & composition

Observe command substitution’s trailing-newline removal

Bash Scripts: Command substitution removes trailing newlines while preserving embedded ones.

Bash Scripts✓ Tested
C#File operations & paths

Process a file as a lazy line sequence

C#: ReadLines avoids allocating one string containing the entire file.

C#✓ Tested
JavaFile operations & binary data

Process a text file one line at a time

Java: Use a buffered reader to avoid loading a large file into memory.

Java✓ Tested
PowerShellFile operations & integrity

Read a file lazily through the .NET line iterator

PowerShell: ReadLines avoids creating one string containing the entire file.

PowerShell✓ Tested
Bash ScriptsLoops & decisions

Read a file without losing its last line

Handle spaces, backslashes, and a final line without a newline.

read lines✓ Tested
PythonStructured data & serialization

Read one JSON document per line

Python: Parse nonempty JSON Lines records independently instead of loading a JSON array.

Python✓ Tested
GoFiles & paths

Read text line by line

Read text line by line using a complete Go program with explicit sample inputs.

Go✓ Tested
Linux CommandsArchive integrity & packaging

Archive filenames safely with null delimiters

Linux Commands: Use find -print0 with tar --null to preserve spaces and embedded newlines in filenames.

Linux Commands✓ Tested