I have a csvCSV file that is exported from SolidWorks, the. The input looks like this:
1,A-00034,1,Approved,"Rotating Conveyor Top Level Assembly, 88-1/2" Long 2.5" Rollers, 57-1/2" BF",01,,,,STRUCT,ASSEMB,,
1.1, P-001991,2,Approved,Hex Bushing to Convert 1/2 NPT to 1/4,01,,,44605K245,Pnuematics,Purchase,,
1.2, P-012527,2,Submit for Approval,Half Union for 5/32" Tubing 1/4 NPT,,,Bimba,KQ2-H03-35AS,PNEU,PURCH,,
1.3, A-03428,1,Approved,Rotating Conveyor Base Frame Assembly,,,,,STRUCT,ASSEMB,,
1.3.1, P-001959,1,Approved,Fixed End Chain Flex Mount,01,11GA HRS x 1-1/2" x 4",,,STRUCT,CUT,,
1.3.2, P-002009,1,Approved,Chain Flex Fixed End,01,,IGUS,2020.4PZ,Hardware,Purchase,,
1.3.3, P-003340,3,Approved,Hex Bushin for 3/8 NPT to 1/4 NPT,02,,McMasterCarr,44605K242,PNEU,PURCH,,
1.3.4, P-013107,1,Approved,3 Position 5 Port Solenoid Valve 24 V DC Exhaust Center with Subplate ,01,,SMC,VFS3400-5FZ-03T,PNEU,PURCH,,
1.3.5, A-00011,1,Approved,Base Weldment for 88" Rotating Conveyor,01,Weldment,,,Structural,Weldment,,
1.3.5.1, P-001916,1,Approved,2-3/16"x10-5/8" Cold Round Shaft with One end blind tapped 1/2-13 hole,01,2-3/16" CRS Round x 10-7/8",,,STRUCT,MACH,,
1.3.5.2, P-012844,6,Approved,1/2x2x3 Hot Rolled Flat With One 1/2" Hole 2-3/8" From one end,01,,,,STRUCT,BURN,,
1.3.5.3, P-001915,1,Approved,Rotating Conveyor Base Plate for 88" Rotator,02,1/2" Burn,,,STRUCT,BURN,,
1.3.5.4, P-001918,1,Approved,2x4x4-3/4" Cold Flat Machined for Cylinder Mount on Rotate Conveyor,01,2" x 4" CRS x 4-3/4",,,STRUCT,MACH,,
1,A-00034,1,Approved,"Rotating Conveyor Top Level Assembly, 88-1/2" Long 2.5" Rollers, 57-1/2" BF",01,,,,STRUCT,ASSEMB,,
1.1, P-001991,2,Approved,Hex Bushing to Convert 1/2 NPT to 1/4,01,,,44605K245,Pnuematics,Purchase,,
1.2, P-012527,2,Submit for Approval,Half Union for 5/32" Tubing 1/4 NPT,,,Bimba,KQ2-H03-35AS,PNEU,PURCH,,
1.3, A-03428,1,Approved,Rotating Conveyor Base Frame Assembly,,,,,STRUCT,ASSEMB,,
1.3.1, P-001959,1,Approved,Fixed End Chain Flex Mount,01,11GA HRS x 1-1/2" x 4",,,STRUCT,CUT,,
1.3.2, P-002009,1,Approved,Chain Flex Fixed End,01,,IGUS,2020.4PZ,Hardware,Purchase,,
1.3.3, P-003340,3,Approved,Hex Bushin for 3/8 NPT to 1/4 NPT,02,,McMasterCarr,44605K242,PNEU,PURCH,,
1.3.4, P-013107,1,Approved,3 Position 5 Port Solenoid Valve 24 V DC Exhaust Center with Subplate ,01,,SMC,VFS3400-5FZ-03T,PNEU,PURCH,,
1.3.5, A-00011,1,Approved,Base Weldment for 88" Rotating Conveyor,01,Weldment,,,Structural,Weldment,,
1.3.5.1, P-001916,1,Approved,2-3/16"x10-5/8" Cold Round Shaft with One end blind tapped 1/2-13 hole,01,2-3/16" CRS Round x 10-7/8",,,STRUCT,MACH,,
1.3.5.2, P-012844,6,Approved,1/2x2x3 Hot Rolled Flat With One 1/2" Hole 2-3/8" From one end,01,,,,STRUCT,BURN,,
1.3.5.3, P-001915,1,Approved,Rotating Conveyor Base Plate for 88" Rotator,02,1/2" Burn,,,STRUCT,BURN,,
1.3.5.4, P-001918,1,Approved,2x4x4-3/4" Cold Flat Machined for Cylinder Mount on Rotate Conveyor,01,2" x 4" CRS x 4-3/4",,,STRUCT,MACH,,
I am basing my current "break" on the segment count (1 = 1, 1.2 = 2, etc.). And using dictionary key: valuevalue pairs to keep the parent: componentscomponents together. And then writing each Key:Value pair out to it's own CSV file for importing into a different system.
Any improvements are welcome and appreciated. Thanks!