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

0 stars

Watchers

1 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages