Author Topic: Generate Index Text from Excel Spreadsheet.  (Read 9422 times)

0 Members and 1 Guest are viewing this topic.

ChrisCarlson

  • Guest
Re: Generate Index Text from Excel Spreadsheet.
« Reply #30 on: June 22, 2016, 02:01:59 PM »
One more thing,
How do I add your credentials to the script. 
It needs a proper author.

It should prompt when loaded "Writen by RonJonP from TheSwamp.org 06-21-2016" that would be sweet.

Typically doing the following will more than suffice the original author.

Code - Auto/Visual Lisp: [Select]
  1. (defun c:importcsv (/ _d _maketext _readcsvfile d file i n p txt x xlst)
  2. ;;Written by ronjonp @ TheSwamp 22-JUN-2016
  3. ;;https://www.theswamp.org/index.php?topic=51580.msg566936#msg566936
  4.   (defun _d (text / r)

DIW_CADtech

  • Bull Frog
  • Posts: 368
  • Push limits, embrace success, & discard failure.
Re: Generate Index Text from Excel Spreadsheet.
« Reply #31 on: June 22, 2016, 02:20:09 PM »
done!
Thanks Chris..  I was looking for more than just comments.. but that'll do..
I am very  trainable....   (forgive my spelling)

danallen

  • Guest
Re: Generate Index Text from Excel Spreadsheet.
« Reply #32 on: June 22, 2016, 04:07:14 PM »
add
Code: [Select]
(princ "\nWritten by ronjonp @ TheSwamp 22-JUN-2016")
put inside the defun and it will show every time it is run

DIW_CADtech

  • Bull Frog
  • Posts: 368
  • Push limits, embrace success, & discard failure.
Re: Generate Index Text from Excel Spreadsheet.
« Reply #33 on: June 22, 2016, 04:24:24 PM »
I am getting an error at the command prompt but the script seems to be functioning properly..

Command: APPLOAD
RONJONP3.lsp successfully loaded.
Command:
Command:
Command: IMPORTCSV
; error: bad argument type: numberp: nil
Command:
I am very  trainable....   (forgive my spelling)

DIW_CADtech

  • Bull Frog
  • Posts: 368
  • Push limits, embrace success, & discard failure.
Re: Generate Index Text from Excel Spreadsheet.
« Reply #34 on: June 22, 2016, 04:26:37 PM »
This is the CSV file I'm using for testing.
I am very  trainable....   (forgive my spelling)

DIW_CADtech

  • Bull Frog
  • Posts: 368
  • Push limits, embrace success, & discard failure.
Re: Generate Index Text from Excel Spreadsheet.
« Reply #35 on: June 22, 2016, 04:28:18 PM »
and the CAD file I'm starting with....
I am very  trainable....   (forgive my spelling)

Cathy

  • Guest
Re: Generate Index Text from Excel Spreadsheet.
« Reply #36 on: June 22, 2016, 05:34:32 PM »
I'm not sure what's going on with the .lsp, but I do note that your .csv has a lot of empty lines at the end.  Try opening it with notepad and deleting all those empty lines. 

ronjonp

  • Needs a day job
  • Posts: 7529
Re: Generate Index Text from Excel Spreadsheet.
« Reply #37 on: June 22, 2016, 05:46:54 PM »
I'm not sure what's going on with the .lsp, but I do note that your .csv has a lot of empty lines at the end.  Try opening it with notepad and deleting all those empty lines.
Agreed .. there are approximately 1200 'empty' rows after your data. I fixed the code in the previous post so it would not error.

Quote
119,58-09-0274,684870SH07,COEN - COMBUSTION ENGINEERS,7 OF 9,2,FUNCTIONAL LOGIC DIAGRAM,BURNER MANAGEMENT SYSTEM ,SOME/ PLANT COMMON,REVISED,
120,58-09-0275,684870SH08,COEN - COMBUSTION ENGINEERS,8 OF 9,1,FUNCTIONAL LOGIC DIAGRAM,BURNER MANAGEMENT SYSTEM ,SOME/ PLANT COMMON,REVISED,
121,58-09-0276,684870SH09,COEN - COMBUSTION ENGINEERS,9 OF 9,2,FUNCTIONAL LOGIC DIAGRAM,BURNER MANAGEMENT SYSTEM ,SOME/ PLANT COMMON,REVISED,
122,DE-58-09-0,D0681870SH06,COEN - COMBUSTION ENGINEERS,6 OF 10,3,SCHEM & CONN DIAG,MFT RELAY PANEL,SOME/ PLANT COMMON,REVISED,
,,,,,,,,,,
,,,,,,,,,,
,,,,,,,,,,
,,,,,,,,,,
,,,,,,,,,,
,,,,,,,,,,


...
« Last Edit: June 22, 2016, 06:52:05 PM by ronjonp »

Windows 11 x64 - AutoCAD /C3D 2023

Custom Build PC

DIW_CADtech

  • Bull Frog
  • Posts: 368
  • Push limits, embrace success, & discard failure.
Re: Generate Index Text from Excel Spreadsheet.
« Reply #38 on: June 22, 2016, 07:31:04 PM »
I was trying to standardize my file for generating the CSV files in Excel.   The 2nd tab with the corrected data is generated with formula's.. to avoid  getting "0" for empty cells.     The largest drawing set we've had to date was just under 1300 drawings.. so I carried the formula's to row 1300

in this set 103 DWGs.. so yes ~1200 blank rows.

Hoping to use this file repeatedly.. just dropping in the project log data on tab "Sheet1" and hopping to tab "Sheet2" and immediately saving to CSV.

Thank you for the code update.
I am very  trainable....   (forgive my spelling)