You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.")
Error:
Exception: failed to load/parse raw-file: invalid block or corrupt buffer at byte: 11
Kind regards
The text was updated successfully, but these errors were encountered: