Expand description
BigText core: file access, encodings, line index, piece table, search, replace and save.
Nothing in this crate depends on the GUI; main.rs hosts the egui front end.
Modules§
- brackets
- Matching brackets and tags: the partner of
(,[,{(and back), the bracket that encloses a position, and for XML / HTML the closing tag of an opening one (and back). - codec
- Decoding and encoding text the way logs and requests carry it: Base64 (and JWTs), URL percent-encoding, hex, HTML entities and JSON string escapes.
- column_
edit - The column editor: a number sequence or the same text in a column of cells, row after row.
The editor applies it to a block’s rows;
column_edit_tostreams it from a line to the end of a file of any size. - correlate
- Ids that tie log lines together — request, trace, span and session ids — found on one line, so the file can be filtered to everything one request did.
- csv
- CSV and TSV: delimiter detection, quote-aware field splitting, and deleting columns from a whole document in one streaming pass with bounded memory, so any file size works.
- csv_
chart - The distribution of one table column: how many rows have values in each range (numbers), each period (times), or of each value (text, the most frequent ones).
- csv_
check - Checking a CSV / TSV file’s records in one pass: a field count other than the table’s, a stray or unclosed quote, control characters, and text in columns that should hold numbers.
- csv_
diff - Comparing two tables by a key column, whatever their row order: each row is paired with the other table’s row with the same key (the n-th duplicate with the n-th), and the result is a table of the rows changed (with old → new values and the names of the changed columns), removed and added. Columns pair up by header name, or by position without headers; the columns only one table has are not compared.
- csv_
expr - Expressions over a table row, for derived columns:
{price} * {qty},substr({ts}, 0, 10),regex({url}, "id=([0-9]+)"),if({status} = "ok", 1, 0). - csv_
join - Joining two tables by a key column: the right (“lookup”) table is read into memory, keyed by its column, and the left table streams past it, each row followed by the other columns of every right row with the same key (a left or an inner join). The result is UTF-8 CSV.
- csv_
pivot - Pivot tables: one row per value of a column (or per day, hour or month of a time column), one column per value of another, and in each cell the number of rows — or the sum, mean, minimum or maximum of a third column — with a total per row.
- decompress
- Compressed files (
.gz,.zst,.xz,.bz2): rotated logs are almost always compressed. They are unpacked once, streaming, into a temporary file that is then opened like any other file, so the editor keeps its random access and bounded memory. Archives (.zip,.tar,.tar.gzand the like) list their files, and the one picked is unpacked the same way. - diff
- Streaming line diff of two (possibly huge) files with bounded memory.
- encoding
- Encodings, line-break handling and detection.
- extract
- The matched texts themselves, not their lines: every match (or one capture group of it) in
order, or counted by value, most frequent first —
grep -o | sort | uniq -cin one pass. - extsort
- Sorting the lines of a file of any size: runs of up to
RUN_BYTESare sorted in memory and written to temporary files, then merged (a k-way merge, in two levels past [MERGE_WAYS] runs). Equal lines can be dropped (unique) or counted (most frequent first). - fields
- The fields of one structured log line — a JSON object (JSON Lines) or logfmt
key=valuepairs — and a streaming count of one field’s values over a whole log. - file
- File access: windowed memory mapping when possible, buffered chunked reads otherwise.
- filter
- Line filter (“grep”): the lines of a document that contain a match — or, inverted, the lines that do not. It streams over the document like search, so memory stays bounded and any file size works. A filter can be limited to one CSV column: a line then counts only when a match lies inside that field. Lines around each kept line (context, or the rest of a log entry such as a stack trace) can be kept with it.
- find_
files - Find in files: the matches of a search in every file of a folder whose name fits a pattern
such as
*.log, file by file with the streaming search, with line numbers and the text around each match. - gaps
- Time gaps in a log: the places where the next line with a timestamp is much later than the one before it (the service was down or quiet) or much earlier (the clock jumped back).
- headless
- BigText’s tools for scripts, without a window:
bigtext-cli COMMAND …(orbigtext --COMMAND …). They stream like the editor does, so they work on files of any size. - histogram
- Time histogram of a log: how many lines, and how many of them match a pattern (errors, the search), fall in each stretch of time — from one pass over the text. Buckets start one second wide and get wider (10 s, 1 min, …) when the log spans too much time, so the histogram stays small for any log.
- index
- Sparse, incremental line index over the original file.
- jobs
- Background-job plumbing: cancellation tokens, progress counters and UI wakers.
- json
- Streaming JSON for files of any size: the direct children of an object or array, page by
page; the value at a path such as
$.items[1234].id; the path of the value at an offset; and JSON Lines (one object per line) to CSV. Values are skipped with a byte loop that tracks only strings and nesting depth, so nothing is ever held in memory as a tree. UTF-8 (or another ASCII-compatible encoding) only. - json_
check - Checking JSON strictly: bad escapes, control characters in strings, trailing commas, NaN and other words, numbers like 01 or 1., brackets that do not match, invalid UTF-8, and text after the value. A whole document stops at its first problem; JSON Lines are checked line by line, and every bad line is listed.
- json_
diff - Comparing two JSON documents by structure: each is flattened into
$.path = valuelines (keys in sorted order, array items by index), the flat forms are compared with the line diff, and the differing lines become changes — a value changed, added or removed — so key order and formatting do not count. - json_
fields - The fields of JSON records — JSON Lines, or the items of a JSON array — in one pass: every key
path to depth 3 (
user.address.city, array items astags[]), with its types, how often it appears, nulls, numbers’ minimum, maximum and mean, and some distinct values and examples. - jsonq
- Field queries over JSON Lines:
.level == "error" and .duration > 500,.user.id = 42,.msg contains timeout,.err exists,.path ~ "^/api/". A line matches when it is a JSON object meeting every condition. - lines
- Reading a text’s lines front to back in large chunks, for jobs that look at every line (merging logs, time histograms).
- loglevel
- Log severity levels: the words that name them and a regex that finds them in a line.
- merge
- Merging logs by time: the lines of several logs in timestamp order, each line labelled with its file, written as one UTF-8 text. Lines without a time (stack traces, continuations) stay with the line above them, and lines before a file’s first time come first. Each file is read once, front to back, so memory use does not depend on the file sizes.
- patch
- Applying a unified diff (a .diff or .patch file) to a text of any size: each hunk is found
where it says, or up to
FUZZlines away when it matches only one place there, in one pass over the text. - patterns
- Message patterns: the lines of a log grouped by template — the line with its leading timestamp dropped and numbers, hex ids, UUIDs, IP addresses and paths replaced by placeholders — so the noisiest messages and the rarest ones stand out.
- pipe
- Running a shell command with text on its standard input and its standard output going to a writer. Input, output and errors are pumped on their own threads, so a chatty command never deadlocks, and cancelling kills it.
- replace
- Replacement: templates (
$1,${name},\n,\t), small batches as piece-table edits and the streaming replace-all that writes a new file with bounded memory. - save
- Crash-safe saving: stream the document to a temp file in the target’s directory, fsync, then atomically replace the target. The original is never touched until the final rename, and any failure leaves it intact.
- search
- Search over byte windows of a
TextBuf. - setdiff
- The lines of one text that occur nowhere in another, whatever their order (a set difference by line), for texts of any size. The other text’s line hashes are held in memory up to a budget; past it both sides are split by hash into partition files on disk and compared one partition at a time.
- settings_
file - Where the app keeps its settings (
state.txt), and the searches saved in it, for the command line to run them (bigtext-cli filter --saved NAME) as the app does. - split
- Cutting a document into pieces: the byte range of a line range, and splitting the whole document into part files of a given size or line count, always at line boundaries. Both stream, so any file size works.
- stats
- A file’s figures in one streaming pass (File → Properties,
bigtext-cli stats): lines, line breaks by kind, the longest line, NUL bytes, bytes that are not UTF-8, a missing final line break, the first and last time; and its SHA-256. - sysinfo
- Process memory statistics (for the status/debug overlay and benchmarks) and free disk space.
- table_
export - Exporting a CSV table, or some of its columns, as JSON, JSON Lines, a Markdown table or an
Excel workbook (.xlsx), streamed record by record. The header names the fields; without one
the columns are called
column1,column2, …. - text
- Text model: piece table (
buffer) and visual row segmentation (rows). - textops
- Text operations on a selection: sorting and de-duplicating lines, changing case, trimming,
converting indentation, and re-formatting JSON. They work on decoded text and keep the
text’s own line breaks; the caller applies the result as one undoable edit, or, for a
document of any size,
text_op_tostreams it to a file. - timestamp
- Log timestamps: recognising one near the start of a line, and finding the first line at or after a given time with a binary search over byte offsets (log lines are in time order), so a jump in a 50 GB log reads only a few hundred kilobytes.
- unified
- Unified diffs (
diff -u): written from a comparison of files of any size, streamed (no line is held in memory), and applied back to a text. - update
- Updates from the project’s GitHub releases: finding newer versions and their release notes, downloading a release file (size and SHA-256 checked) and installing it. A portable copy swaps its executable in place; a copy installed with the Windows setup program runs the new installer once BigText has exited. Everything here blocks, so it runs on worker threads.
- xml
- Streaming XML for files of any size, for the structure panel: the child elements of an
element, page by page; the element at a path such as
/catalog/item[1234]/price(1-based, like XPath); and the path of the element at an offset. Elements are skipped with a byte loop over tags, comments, CDATA and processing instructions, so nothing is held as a tree. UTF-8 (or another ASCII-compatible encoding) only.