IMCtermite icon indicating copy to clipboard operation
IMCtermite copied to clipboard

Converting raw files from version imc STUDIO 2022 R3 (03.10.2022) not working

Open Danarrow opened this issue 2 years ago • 2 comments

  • Updating IMCtermite to V2.0.7
  • Converting raw-file with version imc STUDIO 5.2 R22 (28.07.2021) works fine.
  • Converting raw-file with version imc STUDIO 2022 R3 (03.10.2022) does not work.

Error: Exception: failed to load/parse raw-file: invalid block or corrupt buffer at byte: 11

Kind regards

Danarrow avatar Apr 03 '23 13:04 Danarrow

@Danarrow Can you please share an example (or at least a representative section) of the problematic raw-file?

mario-fink avatar Apr 04 '23 22:04 mario-fink

Hi,

I am getting the same error when trying to convert .RAW file to .CSV file. I am new to python coding so couldn't figure out myself. here is the .raw file https://drive.google.com/file/d/1Mq-rWilk7zJVfb14cZh6yzjvylcVbRP5/view?usp=sharing

here is the code: import IMCtermite import os

def convert_raw_to_csv(folder_path): # Get the list of .raw files in the folder raw_files = [file for file in os.listdir(folder_path) if file.lower().endswith('.raw')]

for raw_file in raw_files:
    raw_file_path = os.path.join(folder_path, raw_file)
    csv_file_name = os.path.splitext(raw_file)[0] + '.csv'
    csv_file_path = os.path.join(folder_path, 'converted', csv_file_name)

    # Create the 'converted' subfolder if it doesn't exist
    os.makedirs(os.path.join(folder_path, 'converted'), exist_ok=True)

    # Convert the .raw file to .csv
    try:
        imcraw = IMCtermite.imctermite(raw_file_path.encode())
        imcraw.print_table(csv_file_path.encode())
        print(f"Conversion successful: {raw_file} -> {csv_file_name}")
    except RuntimeError as e:
        print(f"Conversion failed for {raw_file}: {e}")

print("Conversion process completed.")

Test the function with a folder path

folder_path = input("Enter the folder path containing .raw files: ") convert_raw_to_csv(folder_path)

any advice would be helpful.

Thanks Pavi.

pavijovi3 avatar Jul 04 '23 18:07 pavijovi3