NexusTools
Large Data InspectionPhotonixDownload Photonix

Inspect Large CSV, JSON and Log Files Offline Without Freezing Your PC

Open 250MB logs, huge CSV exports and JSONL files offline. Learn mmap, SIMD search, RFC 4180 quirks and a safe Photonix triage workflow.

NexusTools Documentation Team
Updated 2026-11-25
9 min read

Key Takeaways

  • Excel, JSON.parse and heap-copy editors all scale with file size; memory mapping opens a 250MB log in about 12ms by touching only visible pages.
  • CSV correctness depends on RFC 4180 quoting, delimiter sniffing and a UTF-8 BOM when the file is destined for Excel.
  • JSONL is the practical format for large event data because each line is independent and one corrupt record does not invalidate the file.
  • Use Ctrl+K on selected evidence, not as an oracle; verify every AI hypothesis against the raw log and keep the query with the conclusion.

1. Why ordinary editors and spreadsheets stall at 250MB

A 250MB CSV is small on disk and enormous in memory. Excel loads the workbook, builds a grid, evaluates formulas and keeps undo state; a file with millions of rows can exhaust memory before it finishes opening. The sheet limit of 1,048,576 rows is only the most visible boundary.

JSON is worse in a different way. Parsing builds an object graph, and a 250MB document can expand to several gigabytes of heap. Pretty-printing allocates another full copy. Browser tabs usually die somewhere between one and four gigabytes, which is why a JSON viewer that works at 10MB fails at 250MB.

Text editors that read the whole file into a buffer face the same arithmetic. Add a line index, syntax highlighting and a DOM node per visible line, and the real cost is several times the file size. When the garbage collector runs, the interface freezes even if the process survives.

Photonix takes a different route. It maps the file read-only with the operating system memory-mapping API, builds a compact line offset index, and reads only the pages needed for the viewport. Opening a 250MB log takes about 12ms on a warm local disk, and the private working set stays small because clean pages can be evicted.

Search uses SIMD instructions to compare many bytes per clock and splits the file across worker threads. A regular expression over 250MB finishes in roughly 120ms, and results stream into the UI instead of blocking it. This is not a database query; it is a fast scan with a deliberately narrow scope.

Know the limits. Memory mapping is fast on a local SSD and much less impressive on a network share. A compressed file must be decompressed before it can be mapped. Editing uses a copy-on-write buffer, so a save still writes data; mmap accelerates reading, it does not make storage infinitely fast.

Virtual scrolling is the other half of the solution. Even with a mapped file, rendering one visual element per line would exhaust the DOM at a million lines. The viewer asks the index which lines fall inside the scroll position, renders a few dozen, and recycles them as you move. Memory stays proportional to the viewport, not the file.

2. CSV and Excel conversions without silent corruption

RFC 4180 is the contract. Fields are separated by commas, quoted when they contain a comma, a quote or a line break, and inner quotes are doubled. A parser that splits on commas will corrupt a support export where a customer message contains both a comma and a newline.

Delimiters are not always commas. European Excel often writes semicolons, exported TSV uses tabs, and some tools use pipes. Good converters sniff the delimiter from the first few lines and let you override the guess. Check the preview before converting a file you cannot easily recreate.

UTF-8 with BOM is the difference between readable Chinese and mojibake in Excel on Windows. Without a BOM, Excel may interpret the bytes as the system ANSI code page. The BOM is harmless to most parsers, so export a BOM copy for Excel and keep the canonical file as UTF-8 without BOM for scripts.

Excel coerces types. An order ID with leading zeros becomes a number, a 16-digit account number becomes scientific notation, and a date-like string is rewritten according to the local locale. Import as text, or keep the data in CSV and use a viewer that does not reinterpret it.

Formula injection is a security issue, not a formatting quirk. A cell that begins with an equals sign, plus, minus or at sign can be evaluated when opened. If you export untrusted data, prefix those cells with an apostrophe or strip the leading character, and document the decision.

The 1,048,576-row limit is real, but most failures happen earlier, when formatting, formulas or a full-column operation force Excel to touch every cell. For a 100MB CSV, a virtual grid that renders only visible rows is the more honest tool. Use Excel for analysis after you have reduced the data.

Check shape before content. Count the delimiter outside quotes on a sample of lines; a row with more fields than the header usually means an unescaped quote upstream. Many real exports contain at least one malformed row, and a converter that silently drops it is more dangerous than one that reports the line number.

Keep the canonical dataset as UTF-8 CSV with Unix line endings, and treat every XLSX as a derived artifact. When someone reports a broken export, compare the CSV and the XLSX instead of debugging the spreadsheet twice.

3. JSON, JSONL and log forensics at scale

JSON is a single document. It is excellent for configuration and API responses, but it is awkward for append-only data because one malformed byte can invalidate the whole file. Streaming parsers reduce memory, yet random access to the millionth record still requires scanning everything before it.

JSONL fixes that by writing one complete JSON object per line. A reader can process the file line by line, a bad line is isolated, and tools such as grep, awk or a log viewer can work without understanding the whole schema. It is the better format for events, exports and model training data.

Pretty-printing is not free. A 250MB minified JSON document can become several gigabytes when indented, and an editor may allocate a second copy while doing it. If you need one field, search the minified text or use a streaming query instead of reformatting the entire file.

Logs are a different shape: timestamps, levels, request identifiers and free-form messages. The useful operations are filtering by time window, extracting a request ID, and finding the first error before a cascade. SIMD regex makes a full scan fast, but narrowing the candidate range first is still cheaper.

Photonix keeps the file mapped, searches with SIMD across worker threads, and renders only the visible lines. Ctrl+K sends the selected context to DeepSeek for a summary or a root-cause hypothesis. It does not send all 250MB; the quality of the answer depends on selecting the right window.

Treat AI output as a hypothesis. A model can explain a stack trace, but it cannot see the database, the deployment history or the traffic graph. Verify every suggested cause against the logs, and keep the evidence next to the note so the next person can reproduce the conclusion.

Schema drift is the quiet failure mode in JSON and JSONL exports. A field may be a string in one release and an object in the next, or disappear entirely. Sample records from the beginning, middle and end of the file, compare their key sets, and write down the differences before you build a parser or a spreadsheet formula around them.

When a log line is too long to read, fold it first and search for the request ID rather than the whole message. Long single-line JSON payloads are the usual reason a regex looks slow: the engine has to inspect megabytes before it finds a newline.

4. A repeatable offline triage workflow

Step one: preserve the evidence. Copy the file, record its size, modification time and a hash, and work on the copy. Incident review is much easier when you can prove that the bytes you analysed are the bytes that arrived, especially if a rotation or a cleanup job later removes the original.

Step two: identify the format before choosing a tool. Check the first bytes for a UTF-8 BOM, a gzip header or a binary signature. A file named .log may be gzip-compressed, UTF-16 or a database dump. Decoding with the wrong assumption produces confident nonsense.

Step three: narrow before you search. Filter by timestamp, request ID or a known marker, then run the expensive expression on the shortlist. A full regex over 250MB is fast with SIMD, but a bad regex that backtracks can still stall any engine. Anchor the pattern and avoid nested quantifiers.

Step four: convert only the slice you need to share. A CSV or JSONL extract with the relevant lines is easier to attach to a ticket than a 250MB archive, and it reduces the chance of leaking unrelated customer data. Keep the full file local and offline.

Step five: write the conclusion next to the evidence. Save the query, the time window and the Photonix version in a short note. A root-cause statement without the query that produced it is folklore, and the next incident will start from zero.

Step six: clean up. Delete temporary extracts, revoke access to the incident folder, and confirm that no file was uploaded to a service that the policy forbids. Offline tools make this easy, but only if you actually keep them offline.

Make the workflow reproducible by another person. Store the commands, the query and the tool version in the incident folder, not in a chat message. When a colleague repeats the steps on the preserved copy, they should reach the same line numbers. If they cannot, the difference is part of the investigation.

PowerShell: count, convert and split a 250MB log without loading it
powershell
$log = ".\access_250mb.log"

# Count lines with a buffered reader instead of Get-Content.
$reader = [System.IO.StreamReader]::new($log, [System.Text.Encoding]::UTF8, $true, 1MB)
$lines = 0
while ($reader.ReadLine() -ne $null) { $lines++ }
$reader.Dispose()
"Lines: $lines"

# Write a UTF-8 BOM copy so Excel reads Chinese and Japanese correctly.
$csv = Get-Content ".\export.csv" -Raw
[System.IO.File]::WriteAllText(
    (Join-Path $PWD "export.excel.csv"),
    $csv,
    [System.Text.UTF8Encoding]::new($true)
)

# Split the log into 50MB parts on line boundaries.
$reader = [System.IO.StreamReader]::new($log)
$part = 0
$writer = $null
while (-not $reader.EndOfStream) {
    if ($null -eq $writer -or $writer.BaseStream.Length -ge 50MB) {
        if ($writer) { $writer.Dispose() }
        $part++
        $writer = [System.IO.StreamWriter]::new(
            ".\access_part$part.log", $false, [System.Text.UTF8Encoding]::new($false))
    }
    $writer.WriteLine($reader.ReadLine())
}
$writer.Dispose()
$reader.Dispose()
Rerun the exact query on a copy before presenting a conclusion. A screenshot is not evidence; the query, the time window and the original file are. If the result changes between runs, the input changed or the pattern is not deterministic.

Engineering Verification & Production Checklist

Before applying these steps in enterprise production workflows, ensure you verify idempotency and maintain isolated data snapshots. For bulk data operations or large file streaming, run tests within sandboxed local sessions before scaling across enterprise infrastructure to ensure complete data consistency.

FAQ

Frequently Asked Questions

Does Photonix upload my log or CSV to a server?

No. The file is mapped read-only by the operating system and searched locally; rendering also happens on your machine. Optional Ctrl+K sends only the selected context, not the whole file. You can verify the core path by disconnecting the network, opening a large log and running a search.

Why does Excel fail on a CSV below its row limit?

The row limit is only the outer boundary. Excel also allocates memory for the grid, formatting, formulas and undo history, and a 250MB file can expand several times in memory. Whole-column formatting or a formula recalculation can exhaust resources even when the row count is legal. Filter in a virtual viewer first, then give Excel the reduced data.

Can Photonix open a 2GB file?

It can open files far larger than 250MB, but the experience depends on disk, memory and line length. A 250MB log opens in about 12ms on a warm local disk; a 2GB file takes longer on first open while the line index is built. Use a local SSD, avoid network shares, and measure on your own hardware instead of trusting a marketing number.

What is JSONL and when should I use it?

JSONL stores one complete JSON object per line. It suits logs, event streams and batch exports because it can be processed line by line, and a single corrupt record affects only one line. A monolithic JSON document can become unreadable after one bad byte. Configuration files and deeply nested documents that must be read as a whole still belong in ordinary JSON.

Windows 11/10 Native App

Put this into practice with Photonix

Local-first 12ms cold load for 250MB logs, SIMD regex search, Ctrl+K AI inline diff refactors, 100 free daily DeepSeek credits, and local Ollama diagnosis.