element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • About Us
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Autodesk EAGLE
  • Products
  • More
Autodesk EAGLE
EAGLE User Support (English) bom3_csv_v2.ulp adds many commas
  • Blog
  • Forum
  • Documents
  • Events
  • Polls
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Autodesk EAGLE to participate - click to join for free!
Actions
  • Share
  • More
  • Cancel
Forum Thread Details
  • State Not Answered
  • Replies 1 reply
  • Subscribers 172 subscribers
  • Views 465 views
  • Users 0 members are here
Related

bom3_csv_v2.ulp adds many commas

H_Lenk
H_Lenk over 1 year ago

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()

  • Sign in to reply
  • Cancel
Parents
  • Oppie51
    0 Oppie51 over 1 year ago

    I've been generating BOMs with bom-am-19 ULP
    Lots of options but I save in html. This opens nicely in a browser for review and imports directly into excel.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
Reply
  • Oppie51
    0 Oppie51 over 1 year ago

    I've been generating BOMs with bom-am-19 ULP
    Lots of options but I save in html. This opens nicely in a browser for review and imports directly into excel.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
Children
No Data
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube