At my office desktop computer (windows 10, only) I encounter since last year a funny problem when using the ULP: bom3_csv_v2.ulp and also load my parts-parameter file.
When I generate Parts and Values as EXCEL files, the rows of the CSV files start with the parts-parameters and then are filled up with commas until column #470.
It is not nice to work at those files with EXCEL!
This problem does not happen with my home desktop PC.
Because I am not smart enough to understand and change the bom3_csv_v2.ulp program, I wrote a tiny Pythion program to get rid of those surplus commas.
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# BOM_Comma.py
#
# Copyleft 5.3.2024, lenkh <lenkh@Uni-Mainz.de>
#
# Program to remove trailing commas in files generated with the
# EAGLE ULP program: bom3_csv_v2.ulp at my Uni-desk PC
import sys
import glob
print()
print(glob.glob("*.csv")) # show local files with csv extension
print()
s = input("Enter EAGLE-BOM file name with many trailing commas => ")
in_file_name = s + ".csv" # input file
out_file_name = s + "_new.csv" # output file
with(
open(in_file_name, "r") as file_1,
open(out_file_name,"w") as file_2
):
for s in file_1: # read the input file
print(s) # original string
# find first occurrece of the many ,,,,,,,,,,,
print()
i = len(s) - 2 # point to right most character
comma = s[i]
while s[i] == comma: # scan string from right to left
i -= 1 # decrement pointer
# copy the string without trailing commas
out_s = ""
j = 0
print(i,j)
for j in range(i+1):
out_s = out_s + s[j]
print(out_s) # show output string
file_2.writelines(str(out_s) + "\r") # write to output file
file_1.close()
file_2.close()