;;;Tool for converting a windows 3.1 card file (in prode.txt) to Comma Delimited Format (CDF) ;;;for import to other applications. Options for fields are: ;;;"Loctn Proj DEsc Client DAte Engr DGnr DWgsz Nodwgs noTes" ;;; ;;; ;;; (DEFUN c:cdfcon (/ prod_file found_ri prod_idx res-line line action end_action edit_line orig_line beg_line ins_line assign_key ) (SETQ prod_file (OPEN (FINDFILE "prode.txt") "r") line (READ-LINE prod_file) ) ;_ end of SETQ (IF (SETQ found_out (FINDFILE "prode.out")) (PROGN (SETQ out_file (OPEN found_out "r")) (WHILE (AND (SETQ idx_line (READ-LINE out_file)) (NOT (EQ idx_line "")) ) ;_ end of and (IF prj_line (SETQ prk_line prj_line) ) ;_ end of if (IF pri_line (SETQ prj_line pri_line) ) ;_ end of if (IF prh_line (SETQ pri_line prh_line) ) ;_ end of if (IF prg_line (SETQ prh_line prg_line) ) ;_ end of if (IF prf_line (SETQ prg_line prf_line) ) ;_ end of if (IF pre_line (SETQ prf_line pre_line) ) ;_ end of if (IF prd_line (SETQ pre_line prd_line) ) ;_ end of if (IF prc_line (SETQ prd_line prc_line) ) ;_ end of if (IF prb_line (SETQ prc_line prb_line) ) ;_ end of if (IF pra_line (SETQ prb_line pra_line) ) ;_ end of if (SETQ pra_line idx_line) ) ;_ end of while (CLOSE out_file) ) ;_ end of progn ) ;_ end of if (IF (SETQ found_ri (FINDFILE "prode.idx")) (PROGN (SETQ ri_file (OPEN found_ri "r")) (SETQ idx_line (READ-LINE ri_file)) (CLOSE ri_file) ) ;_ end of progn ) ;_ end of if (WHILE (AND line (NOT end_action)) (WHILE idx_line (WHILE (AND (NOT (EQ "" a_line)) (NOT (EQ line idx_line))) ;_ end of AND (IF c_line (SETQ d_line c_line) ) ;_ end of if (IF b_line (SETQ c_line b_line) ) ;_ end of if (IF a_line (SETQ b_line a_line) ) ;_ end of if (SETQ a_line line) (SETQ line (READ-LINE prod_file)) ;_ end of SETQ ) ;_ end of while (IF prj_line (PRINC (STRCAT "\n Project: " (SUBSTR prj_line 4))) ; (PRINC (STRCAT "\n : " d_line)) ) ;_ end of if (IF pri_line (PRINC (STRCAT "\nDescription: " (SUBSTR pri_line 2))) ; (PRINC (STRCAT "\n : " d_line)) ) ;_ end of if (IF prh_line (PRINC (STRCAT "\n Client: " (SUBSTR prh_line 2))) ; (PRINC (STRCAT "\n : " d_line)) ) ;_ end of if (IF prg_line (PRINC (STRCAT "\n Date: " (SUBSTR prg_line 2))) ; (PRINC (STRCAT "\n : " d_line)) ) ;_ end of if (IF prf_line (PRINC (STRCAT "\n Engineer: " (SUBSTR prf_line 2))) ; (PRINC (STRCAT "\n : " d_line)) ) ;_ end of if (IF pre_line (PRINC (STRCAT "\n Drawn: " (SUBSTR pre_line 2))) ; (PRINC (STRCAT "\n : " d_line)) ) ;_ end of if (IF prd_line (PRINC (STRCAT "\n Sheet Size: " (SUBSTR prd_line 2))) ; (PRINC (STRCAT "\n : " c_line)) ) ;_ end of if (IF prc_line (PRINC (STRCAT "\n No. Sheets: " (SUBSTR prc_line 2))) ; (PRINC (STRCAT "\n : " b_line)) ) ;_ end of if (IF prb_line (PRINC (STRCAT "\n Location: " (SUBSTR prb_line 2))) ; (PRINC (STRCAT "\n : " a_line)) ) ;_ end of if (IF pra_line (PRINC (STRCAT "\n Notes: " (SUBSTR pra_line 2))) ; (PRINC (STRCAT "\n : " a_line)) ) ;_ end of if (IF line (PRINC (STRCAT "\n\nResume Line:" line)) ; (PRINC (STRCAT "\n : " line)) ) ;_ end of if (SETQ skipto (ukword 1 "Yes No" "\nSkip to next match? \"Yes No\"" "") ) ;_ end of setq (IF (EQ skipto "No") (SETQ res-line idx_line idx_line nil ) ;_ end of SETQ (SETQ line (READ-LINE prod_file) idx_line "\\\\\\" ) ;_ end of SETQ ) ;_ end of if ) ;_ end of while (WHILE (AND (NOT (EQ action "Next")) (NOT end_action) line) (SETQ action (ukword 1 "Assign Delete Next End" (STRCAT "Action for \"" line "\" " "(Assign, Delete, Next, End)" ) ;_ end of strcat (IF action action "" ) ;_ end of if ) ;_ end of ukword res-line line ) ;_ end of setq (IF (EQ action "End") (SETQ end_action T) ;_ end of SETQ ) ;_ end of IF (COND ((EQ action "Assign") (IF (EQ (SETQ edit_line (ukword 1 "Edit As-is" (STRCAT "Edit \"" line "\" or As-is? ") ;_ end of strcat "As-is" ) ;_ end of ukword ) ;_ end of setq "Edit" ) ;_ end of eq (PROGN (COMMAND ".text" (GETVAR "viewctr") 0.2 0 line "") (COMMAND ".ddedit" "l" "") (SETQ orig_line line) (SETQ line (CDR (ASSOC 1 (ENTGET (ENTLAST))))) (ENTDEL (ENTLAST)) (assign_line) (WHILE (EQ (SETQ ins_line (ukword 1 "Yes No" (STRCAT "Split \"" orig_line "\" to another field? " ) ;_ end of strcat (IF ins_line ins_line "" ) ;_ end of if ) ;_ end of ukword ) ;_ end of SETQ "Yes" ) ;_ end of EQ (COMMAND ".text" (GETVAR "viewctr") 0.2 0 orig_line "") (COMMAND ".ddedit" "l" "") (SETQ line (CDR (ASSOC 1 (ENTGET (ENTLAST))))) (ENTDEL (ENTLAST)) (assign_line) ) ;_ end of while ) ;_ end of progn (assign_line) ) ;_ end of if ) ) ;_ end of cond (SETQ last_line line) (SETQ line (READ-LINE prod_file)) ) ;_ end of while (IF (AND (OR (EQ action "Next") end_action) (OR proj descr client date engr dgnr dwgsz nodwg loctn notes ) ;_ end of OR ) ;_ end of AND (PROGN (SETQ out_file (OPEN "prode.out" "a") action "Assign" ) ;_ end of SETQ (WRITE-LINE (STRCAT "\\\\\\" (IF proj proj "" ) ;_ end of if ) ;_ end of strcat out_file ) ;_ end of write-line (WRITE-LINE (STRCAT "\\" (IF descr descr "" ) ;_ end of if ) ;_ end of strcat out_file ) ;_ end of write-line (WRITE-LINE (STRCAT "\\" (IF client client "" ) ;_ end of if ) ;_ end of strcat out_file ) ;_ end of write-line (WRITE-LINE (STRCAT "\\" (IF date date "" ) ;_ end of if ) ;_ end of strcat out_file ) ;_ end of write-line (WRITE-LINE (STRCAT "\\" (IF engr engr "" ) ;_ end of if ) ;_ end of strcat out_file ) ;_ end of write-line (WRITE-LINE (STRCAT "\\" (IF dgnr dgnr "" ) ;_ end of if ) ;_ end of strcat out_file ) ;_ end of write-line (WRITE-LINE (STRCAT "\\" (IF dwgsz dwgsz "" ) ;_ end of if ) ;_ end of strcat out_file ) ;_ end of write-line (WRITE-LINE (STRCAT "\\" (IF nodwg nodwg "" ) ;_ end of if ) ;_ end of strcat out_file ) ;_ end of write-line (WRITE-LINE (STRCAT "\\" (IF loctn loctn "" ) ;_ end of if ) ;_ end of strcat out_file ) ;_ end of write-line (WRITE-LINE (STRCAT "\\" (IF notes notes "" ) ;_ end of if ) ;_ end of strcat out_file ) ;_ end of write-line (SETQ proj nil descr nil client nil date nil engr nil dgnr nil dwgsz nil nodwg nil loctn nil ) ;_ end of setq (CLOSE out_file) ) ;_ end of progn ) ;_ end of if (SETQ action "Assign" line (READ-LINE prod_file) last-line nil ) ;_ end of setq ) ;_ end of while (IF (AND res-line (SETQ found_ri (FINDFILE "prode.idx"))) (PROGN (SETQ ri_file (OPEN found_ri "w")) ;_ end of setq (WRITE-LINE res-line ri_file) (SETQ res-line nil) (CLOSE ri_file) ) ;_ end of progn ) ;_ end of IF (CLOSE prod_file) ) ;_ end of defun (DEFUN assign_line (/) (SETQ assign_key (ukword 1 "Loctn Proj DEsc Client DAte Engr DGnr DWgsz Nodwgs noTes" (STRCAT "Assign \"" line "\" to which field:\n" ) ;_ end of STRCAT "" ) ;_ end of ukword ) ;_ end of setq (COND ((EQ assign_key "Proj") (SETQ proj line)) ((EQ assign_key "DEsc") (IF descr (SETQ descr (STRCAT descr " " line)) (SETQ descr line) ) ;_ end of if ) ((EQ assign_key "Client") (IF client (SETQ client (STRCAT client " " line)) (SETQ client line) ) ;_ end of if ) ((EQ assign_key "DAte") (SETQ date line)) ((EQ assign_key "Engr") (IF engr (SETQ engr (STRCAT engr " " line)) (SETQ engr line) ) ;_ end of if ) ((EQ assign_key "DGnr") (IF dgnr (SETQ dgnr (STRCAT dgnr " " line)) (SETQ dgnr line) ) ;_ end of if ) ((EQ assign_key "DWgsz") (IF dwgsz (SETQ dwgsz (STRCAT dwgsz " " line)) (SETQ dwgsz line) ) ;_ end of if ) ((EQ assign_key "Nodwgs") (IF nodwg (SETQ nodwg (STRCAT nodwg " " line)) (SETQ nodwg line) ) ;_ end of if ) ((EQ assign_key "Loctn") (IF loctn (SETQ loctn (STRCAT loctn " " line)) (SETQ loctn line) ) ;_ end of if ) ((EQ assign_key "noTes") (IF notes (SETQ notes (STRCAT notes " " line)) (SETQ notes line) ) ;_ end of if ) ) ;_ end of cond ) ;_ end of defun ;|«ViLL© FORMAT OPTIONS...» (72 2 20 2 T "end of " 60 9 2 0 0 T nil nil T) ***Don't add text below the comment!***|;