Skip to content

AFJGitHubDev24/File-Converters

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

7 Commits
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ”„ PRN to CSV Converter

This Python script batch-processes binary .PRN files and converts them into clean .CSV files for easier analysis.

πŸš€ Features

  • Reads binary .PRN files containing 32-bit floating-point values.
  • Drops initial 29 records (often metadata or calibration noise).
  • Outputs clean CSV files with a single Spectrum column.
  • Processes all .PRN files in a specified input directory.

πŸ“ Folder Structure

inputprnswc/       # Put your .PRN files here  
outputcsvswc/      # CSVs will be saved here after conversion

πŸ› οΈ How It Works

  1. Reads binary data in 4-byte chunks (single float per chunk).
  2. Converts values into a list of dictionaries.
  3. Skips the first 29 entries.
  4. Writes the rest into a .csv using pandas.

βœ… Usage

Just update the paths and run:

input_folder = r"inputprnswc"
output_folder = r"outputcsvswc"
process_all_prn_files(input_folder, output_folder)

πŸ“¦ Dependencies

  • Python 3.6+
  • pandas
  • struct
  • os
  • pathlib

Install with:

pip install pandas

πŸ“Š Output Format

Each CSV will contain:

Spectrum
0.123456
0.654321
...

πŸͺͺ LICENSE

This project is under the Creative Commons Zero v1.0 Universal license.

About

Reference for converting a certain kind of file into some other files

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages