Skip to content
Back to skills

Metadata Extraction From Fixed Offset Records

ASecurity

Use when you have a binary file (e.g., NV format) with a known fixed-size

  • 16 stars
  • 0 votes
  • 0 copies
  • 5 views
  • Added September 12, 2026
ai-agentsgit

Security analysis

A100/100

Scanned September 12, 2026

npx -y skills add HolobiomicsLab/asb-skill-collections --skill metadata-extraction-from-fixed-offset-records --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Metadata Extraction From Fixed Offset Records?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Metadata Extraction From Fixed Offset Records
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/holobiomicslab-metadata-extraction-from-fixed-offset-records/badge)](https://www.skillsdirectory.com/skills/holobiomicslab-metadata-extraction-from-fixed-offset-records)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: metadata-extraction-from-fixed-offset-records
description: Use when you have a binary file (e.g., NV format) with a known fixed-size
  header block (e.
license: CC-BY-4.0
metadata:
  edam_operation: http://edamontology.org/operation_3434
  edam_topics:
  - http://edamontology.org/topic_3520
  tools:
  - NMRFx
  techniques:
  - NMR
  license_tier: restricted
  provenance_tier: literature
derived_from:
- doi: 10.1038/s42004-025-01812-8
  title: NMRFx
evidence_spans:
- github.com__nanalysis__nmrfx
- github.com/nanalysis/nmrfx
claims: []
provenance:
  collection: https://w3id.org/holobiomicslab/asb-skill/collection/metabolomics/v2
  assembled_by: scripts/collect_metabolomics_collection.py
  sources:
  - build: coll_nmrfx_cq
    doi: 10.1038/s42004-025-01812-8
    title: NMRFx
  dedup_kept_from: coll_nmrfx_cq
schema_version: 0.2.0
attribution:
  generator: AgenticScienceBuilder
  original_doi: 10.1038/s42004-025-01812-8
  all_source_dois:
  - 10.1038/s42004-025-01812-8
  zenodo_doi: 10.5281/zenodo.20794027
  curators: []
  promoter: Louis-Félix Nothias
  sponsor: CNRS & Université Côte d'Azur
---

# metadata-extraction-from-fixed-offset-records

> **License: restricted** — no clear open-source license detected for the underlying tool; verify licensing before commercial use or redistribution. <!-- asb-license-banner -->
## Summary

Extract and validate structured metadata from binary files with fixed-offset record layouts by reading at known byte positions, validating magic numbers and field consistency, and serializing parsed headers to structured output. Essential for reverse-engineering and parsing proprietary NMR file formats where header structure is known but parsing tools are unavailable.

## When to use

You have a binary file (e.g., NV format) with a known fixed-size header block (e.g., 2048 bytes) containing magic integers, version fields, and dimensioned metadata at fixed byte offsets, and you need to extract, validate, and serialize these fields for downstream analysis or format conversion.

## When NOT to use

- Input file has variable-length or self-describing headers (e.g., XML, HDF5, NetCDF) — use a format-specific parser instead.
- Byte offsets or record structure are unknown or undocumented — reverse engineering is required before this skill applies.
- Magic number validation is not applicable or the file format lacks a magic integer sentinel — use alternative validation (e.g., file extension, content heuristics).

## Inputs

- binary file with fixed-offset header structure (e.g., NV file)
- byte-offset map and expected magic integer value
- dimension count and per-dimension record size

## Outputs

- parsed header object (magic, version, endianness, nDim, dimension metadata)
- JSON serialization of header metadata
- endianness flag (big-endian or little-endian)

## How to apply

Read the first fixed-size header block (e.g., 2048 bytes) from the binary file using a binary reader (RandomAccessFile or equivalent). Extract the magic integer at bytes 0–3 and validate it against the expected value (e.g., 874032077 for NV files); test little-endian encoding if big-endian fails and record the detected endianness. Parse all file-level header fields (e.g., version, fileHeaderSize, blockHeaderSize, blockElements, nDim) from the designated byte ranges as integers. For each declared dimension (0 to nDim − 1), read the fixed-size dimension record (e.g., 128 bytes at offset 1024 + dim × 128) and extract all subfields (size, blockSize, nBlocks, spectrometer frequency, sweep width, reference point, reference value, reference units, label, complex flag, freqdomain flag, phase angles, vsize). Cross-validate consistency: confirm fileHeaderSize matches the declared header size and blockElements aligns with the product of per-dimension blockSizes. Serialize all parsed metadata (magic, version, nDim, all dimension records, detected endianness) to a structured JSON output file for programmatic access.

## Related tools

- **NMRFx** (NMR file format library and visualization tool supporting NV file parsing and header extraction) — https://github.com/nanalysis/nmrfx

## Evaluation signals

- Magic integer extracted at bytes 0–3 matches expected value (874032077) or valid little-endian variant.
- fileHeaderSize field matches the declared 2048-byte header block size.
- blockElements product (nBlocks₀ × nBlocks₁ × … × nBlocksₙ) matches declared blockElements.
- All dimension records parse without out-of-bounds reads; nDim ≤ 8 and each dimension offset is within the 2048-byte header.
- JSON serialization is valid and round-trips: re-reading parsed JSON reproduces original byte offsets and field values.

## Limitations

- Endianness detection relies on magic-number mismatch; files with corrupted or non-standard magic integers may be misclassified or fail validation.
- Fixed-offset parsing assumes the header structure is invariant across file versions; version changes that alter field positions or sizes will break compatibility.
- No error recovery: if any fixed-offset read fails (e.g., file is truncated), the entire parse halts; partial header recovery is not implemented.
- Dimension metadata is assumed to occupy contiguous 128-byte records starting at offset 1024; non-standard layouts or padding schemes are not detected.

## Evidence

- [other] Read the first 2048 bytes from the input NV file using RandomAccessFile or equivalent binary reader.: "Read the first 2048 bytes from the input NV file using RandomAccessFile or equivalent binary reader."
- [other] Extract and validate the magic integer (bytes 0–3) against the expected value 874032077; if mismatch, test little-endian encoding and set endianness flag accordingly.: "Extract and validate the magic integer (bytes 0–3) against the expected value 874032077; if mismatch, test little-endian encoding and set endianness flag accordingly."
- [other] Parse file-level header fields (bytes 4–28): version, fileHeaderSize, blockHeaderSize, blockElements, nDim, returning each as an integer.: "Parse file-level header fields (bytes 4–28): version, fileHeaderSize, blockHeaderSize, blockElements, nDim, returning each as an integer."
- [other] For each of nDim dimensions (0 to 7), read the 128-byte dimension section starting at offset 1024 + dim*128: "For each of nDim dimensions (0 to 7), read the 128-byte dimension section starting at offset 1024 + dim*128"
- [other] Validate consistency: confirm fileHeaderSize matches declared size and blockElements aligns with product of per-dimension blockSizes.: "Validate consistency: confirm fileHeaderSize matches declared size and blockElements aligns with product of per-dimension blockSizes."

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.