Open Danarrow opened 1 year ago
@Danarrow Can you please share an example (or at least a representative section) of the problematic raw-file?
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):
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.")
folder_path = input("Enter the folder path containing .raw files: ") convert_raw_to_csv(folder_path)
any advice would be helpful.
Thanks Pavi.
Error: Exception: failed to load/parse raw-file: invalid block or corrupt buffer at byte: 11
Kind regards