Loading ...
Sorry, an error occurred while loading the content.

Re: [Clip] CSV to STK

Expand Messages
  • Don Passenger
    It is very do-able in notetab. I would start by going to Jody s snatch a clip and looking up his sort by field clips. I would start by sorting on field 10,
    Message 1 of 3 , Jul 1, 2001
    • 0 Attachment
      It is very do-able in notetab.
      I would start by going to Jody's snatch a clip and looking up his sort by
      field clips.

      I would start by sorting on field 10, then I would set a variable = field 10
      and write to files each record until field 10 changes.

      ----- Original Message -----
      From: <westerman@...>
      To: <ntb-clips@yahoogroups.com>
      Sent: Sunday, July 01, 2001 10:29 PM
      Subject: [Clip] CSV to STK


      > I have a cabinet design software that outputs the following CSV file
      > for the parts needed to build the cabinet. This represent 7 of the
      > parts. There are actually many more.
      >
      >
      > "APS Fleet","APS FLEET","1-12","1","28","29","28","29","BACK","1/2
      > MELAMINE-2
      > SIDES","","","","","","","","","","","","","","","","","","","Length",
      > "071T05Y0","","","","","",""
      > "APS Fleet","APS FLEET","1-9","1","28","26","28","26","BACK","1/2
      > MELAMINE-2
      > SIDES","","","","","","","","","","","","","","","","","","","Length",
      > "071T0410","","","","","",""
      > "APS Fleet","APS FLEET","1-10","1","28","26","28","26","BACK","1/2
      > MELAMINE-2
      > SIDES","","","","","","","","","","","","","","","","","","","Length",
      > "071T04Z0","","","","","",""
      > "APS Fleet","APS FLEET","1-
      > 12","1","4","27.5","4","27.5","NAILERS","1/2 MELAMINE-2
      > SIDES","","","","","","","","","","","","","","","","","","","Length",
      > "071P05X0","","","","","",""
      > "APS Fleet","APS FLEET","1-
      > 12","1","4","27.5","4","27.5","NAILERS","1/2 MELAMINE-2
      > SIDES","","","","","","","","","","","","","","","","","","","Length",
      > "071P0600","","","","","",""
      > "APS Fleet","APS FLEET","1-
      > 7","1","23","46.5","22.97","46.5","FLOOR","3/4 MELAMINE-2
      > SIDES","1L","Front","1 mm 15/16 PVC Edg
      > Bnd","0.03","","","","","","","","","","","","","","","Length","072H03
      > 10","","","","","",""
      > "APS Fleet","APS FLEET","1-
      > 7","1","23","46.5","22.97","46.5","FLOOR","3/4 MELAMINE-2
      > SIDES","1L","Front","1 mm 15/16 PVC Edg
      > Bnd","0.03","","","","","","","","","","","","","","","Length","072N03
      > 20","","","","","",""
      >
      > I need a clip that will create two or more new files from a sorting
      > of the data in cell 10. In this case cell 10 is 1/2 MELAMINE-2 SIDES
      > for some parts and 3/4 MELAMINE-2 SIDES for other parts. There may be
      > as many as 6 different materials listed in cell 10.
      >
      > After the clip sorts this into two or more new files, the files need
      > to be named from the first 6 characters of the data in cell 1 and two
      > numbers starting with 01. Thus, file one would be APSFLE01.STK, file
      > two would be APSFLE02.STK, etc. STK files go directly into another
      > software that optimizes the parts layout on a sheet of material to
      > get the best yield.
      >
      > Then each of these two or more files would need to be reformated into
      > the following STK format. Only data from cell 4,7,8 and 9 to be used.
      > The rest is discarded.
      >
      >
      > first file
      >
      >
      > [ISTK-1]
      > L=28.00 ;7th piece of data
      > B=29.00 ;8th piece of data
      > A=1 ;4th piece of data
      > REF=BACK ;9th piece of data
      > [ISTK-1]
      >
      > [ISTK-2]
      > L=28.00
      > B=26.00
      > A=1
      > REF=BACK
      > [ISTK-2]
      >
      > [ISTK-3]
      > L=28.00
      > B=26.00
      > A=1
      > REF=BACK
      > [ISTK-3]
      >
      > [ISTK-4]
      > L=4.00
      > B=27.5
      > A=1
      > REF=NAILERS
      > [ISTK-4]
      >
      > [ISTK-5]
      > L=4.00
      > B=27.5
      > A=1
      > REF=NAILERS
      > [ISTK-5]
      >
      >
      > second file
      >
      >
      > [ISTK-1]
      > L=22.97
      > B=46.5
      > A=1
      > REF=FLOOR
      > [ISTK-1]
      >
      > [ISTK-2]
      > L=23.25
      > B=46.5
      > A=1
      > REF=FLOOR
      > [ISTK-2]
      >
      >
      > Then each to be saved.
      >
      > Is this something within the abilities of a NoteTab clip? Or should I
      > seek other software to do this? I spend several hours retyping data
      > from one software into another each week.
      >
      > Thanks
      >
      > Craig ><>
      > westerman@...
      >
      >
      >
      >
      >
      >
      > Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
      >
      >
    • westerman@chanuteks.com
      ... sort by ... field 10 ... Don, Thanks for the tip. I tried Jody s NoteBlock:Extract Two Fields clip It crashes NoteTab everytime. I don t think it likes all
      Message 2 of 3 , Jul 1, 2001
      • 0 Attachment
        --- In ntb-clips@y..., "Don Passenger" <dpasseng@i...> wrote:
        > It is very do-able in notetab.
        > I would start by going to Jody's snatch a clip and looking up his
        sort by
        > field clips.
        >
        > I would start by sorting on field 10, then I would set a variable =
        field 10
        > and write to files each record until field 10 changes.
        >


        Don,

        Thanks for the tip.

        I tried Jody's NoteBlock:Extract Two Fields clip

        It crashes NoteTab everytime. I don't think it likes all the double
        quote marks. Any suggestions as to why this clip doesn't like my data?

        Thanks

        Craig ><>
        westerman@...
      • Harvey R. Savage
        Craig and all, Here is my contribution so far for Craig s file conversion. Doesn t do everything, like number the files the way he asked and I didn t know the
        Message 3 of 3 , Jul 3, 2001
        • 0 Attachment
          Craig and all,

          Here is my contribution so far for Craig's file conversion.
          Doesn't do everything, like number the files the way he asked and
          I didn't know the criteria for separating the data into 2 files
          as he wanted.

          Also, I didn't know what he wanted to do with the data in field
          10 so I peeled it off into another file.

          hrs

          H="csv_2_istk"
          ^!SetScreenUpdate off
          ; -----this line creates new folder and exits
          ^!IfPathExist "^$GetAppPath$csv_2_stk\" SKIP_2
          ^!MkDir ^$GetAppPath$csv_2_stk\
          ^!Goto EXIT
          ; -----this line opens a csv file you pick
          ; ---- long line
          ^!Open ^?{(T=o)Choose CSV file to
          convert=^$GetAppPath$csv_2_stk\}
          ^!SetWordWrap OFF
          ;
          ; -----these lines start count and extract the different fields
          ^!Jump 1
          ^!Set %LineCount%=^$GetLineCount$
          ^!Set %ISTK%=0
          ^!Dec %linecount%
          ^!Set %formcount%=^%linecount
          ;
          :Loop
          ^!IfTrue ^$IsEmpty(^%ISTK%)$ Skip
          ^!Inc %ISTK%
          ^!SetDelimiter ","
          ^!Set %L%=^$GetField(-1;7)$
          ^!Set %B%=^$GetField(-1;8)$
          ^!Set %A%=^$GetField(-1;4)$
          ^!Set %REF%=^$GetField(-1;9)$
          ^!Set %f_ten%=^$GetField(-1;10)$
          ;
          ; -----this line writes 4 fields (L, B, A, REF) from each line to
          a file
          ; ---- long line
          ^!AppendToFile "^$GetAppPath$csv_2_stk\^$Getname(^##)$_2.stk"
          [ISTK-^%istk%]^%nl%L=^%l%^%nl%B=^%b%^%nl%A=^%a%^%nl%REF=^%ref%^%nl%[ISTK-^%istk%]^%nl%^%nl%
          ;
          ; -----this line writes field 10 to another file
          ; ---- long line
          ^!AppendToFile "^$GetAppPath$csv_2_stk\^$Getname(^##)$_f_ten.stk"
          [ISTK-^%istk%]^%nl%^%f_ten%^%nl%[ISTK-^%istk%]^%nl%^%nl%
          ;
          ^!If ^%istk% = ^%LineCount% addform
          ;
          ^!Jump +1
          ^!Goto Loop
          ;
          :addform
          ; -----these lines add other info to the main file
          ^!Set %ISTK%=0
          :formloop
          ^!IfTrue ^$IsEmpty(^%ISTK%)$ Skip
          ^!Inc %ISTK%
          ;
          ; ---- long line
          ^!AppendToFile "^$GetAppPath$csv_2_stk\^$Getname(^##)$_2.stk"
          [ISTK$FORM-^%istk%]^%nl%[ISTK$FORM-^%istk%]^%nl%^%nl%
          ;
          ;
          ^!If ^%istk% = ^%formcount% end
          ;
          ^!Goto formLoop
          ;
          :end
          ; ---- long line
          ^!AppendToFile "^$GetAppPath$csv_2_stk\^$Getname(^##)$_2.stk"
          [ISTKALG]^%nl%DATUM=xxxxxx^%nl%[ISTKALG]^%nl%^%nl%[ISTKALG$FORM]^%nl%[ISTKALG$FORM]^%nl%
        Your message has been successfully submitted and would be delivered to recipients shortly.