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

CLIP HELP pls - a small editing clip needed

Expand Messages
  • Howard Grimsdale
    Hi guys - I need help for this clip... I have 6386 lines of (Point Of Sale) CSV database records which each need to be edited/truncated after the fifth field
    Message 1 of 5 , Mar 23, 2005
    • 0 Attachment
      Hi guys - I need help for this clip...

      I have 6386 lines of (Point Of Sale) CSV database records which each
      need to be edited/truncated after the fifth field in every record, which
      all have common removal start/end points.

      We need to remove all info after the 5th field, normally the 4 digit
      postcodes starting with "3***" to the end of line, ^P character. Some
      postcode fields may be empty but will be evaluated & removed manually,
      so their 'emptiness' is irrelevant.

      Example lines below are representative selection from the CSV.

      E.g. remove from (inclusive) comma :
      ,"93973084","A","F","","41.65","641.65"
      (as seen in first csv record below)

      "KOVACEK","MRS P KOVACEK","39 SMITH ROAD","SMITHVILLE
      VIC","3146","93973084","A","F","","41.65","641.65"
      "KOVACS","MISS Z. KOVACS","UNIT 8/729 SMYTHE RD","MALVERN
      WEST","3145","98850813","","F","","96.81","496.82"
      "KOTTKIN","MRS KOTTKIN","","","","95717114","BUS #
      95291775","F","","93.93","3293.93"

      Gurus are GO! TIA

      Kind regards - Howard
      --
      Howard Grimsdale
      howard_g@...
    • Alan C
      Hi Howard, I just wrote the next off the top of my head. The getfield or getfields (if there is a plural) or even something else may not or may be better than
      Message 2 of 5 , Mar 23, 2005
      • 0 Attachment
        Hi Howard,

        I just wrote the next off the top of my head. The getfield or getfields
        (if there is a plural) or even something else may not or may be better
        than this I've shared. Principle of mine here is it gets line into
        array -- then merely print back out (insert) from array as many fields
        as you want so as to effectively replace the former line with these
        "slices from array" so to speak. | Alan.

        ; clip its code begins
        ^!Jump DOC_START

        :four_fields_do
        ; ^!Select LINE ; not needed at this point see getline at setarray line
        ; (next line) 4 array is it setdelimiter or setlistdelimiter?
        ; ^!SetListDelimiter "'"
        ; ^!Setarray %x%=$getline
        ; select line or delete line here so that next insert replaces former
        ; ^!InsertText "^%x1%","^%x2%","^%x3%","^%x4%"
        ; try the above or next line but not both of them
        ; ^!InsertCode "^%x1%","^%x2%","^%x3%","^%x4%"
        ; ^!Jump +1
        ; a check 4 end of doc is needed
        ^!Continue Loop again 2 4_fields_do and back here?
        ^!Goto four_fields_do
        ; clip its code ends

        Howard Grimsdale wrote:

        >Hi guys - I need help for this clip...
        >
        >I have 6386 lines of (Point Of Sale) CSV database records which each
        >need to be edited/truncated after the fifth field in every record, which
        >all have common removal start/end points.
        >
        >We need to remove all info after the 5th field, normally the 4 digit
        >postcodes starting with "3***" to the end of line, ^P character. Some
        >postcode fields may be empty but will be evaluated & removed manually,
        >so their 'emptiness' is irrelevant.
        >
        >Example lines below are representative selection from the CSV.
        >
        >E.g. remove from (inclusive) comma :
        > ,"93973084","A","F","","41.65","641.65"
        >(as seen in first csv record below)
        >
        >"KOVACEK","MRS P KOVACEK","39 SMITH ROAD","SMITHVILLE
        >VIC","3146","93973084","A","F","","41.65","641.65"
        >"KOVACS","MISS Z. KOVACS","UNIT 8/729 SMYTHE RD","MALVERN
        >WEST","3145","98850813","","F","","96.81","496.82"
        >"KOTTKIN","MRS KOTTKIN","","","","95717114","BUS #
        >95291775","F","","93.93","3293.93"
        >
      • Jody
        Hi Howard, You want the Delete Field... Clip in the Library below You might be interested in trying out my Library called NoteBlock which works specifically
        Message 3 of 5 , Mar 24, 2005
        • 0 Attachment
          Hi Howard,

          You want the Delete Field... Clip in the Library below

          You might be interested in trying out my Library called NoteBlock
          which works specifically with delimited files. You can sort by
          fields (column), delete fields, reorder fields, replace in
          fields, and more... As always, use on a test document first to
          ensure there are no bugs and you should have a backup. ;)

          http://www.notetab.net/zip/noteblock.zip <-- Contains only the Library
          http://www.notetab.net/zip/noteblockbar.zip <-- Contains the Library plus
          Clipbar w/ buttons

          Block, field, and column are used interchangeably in the Library.

          New Fookes Software Product - Aid4Mail: http://www.fookes.us/aid4mail
          Convert many eMail program's eMail to/from another eMail program
          and archive in ZIP files if desired. MHT web browser outputs and
          run same from CD-ROM automatically.

          >I have 6386 lines of (Point Of Sale) CSV database records which each
          >need to be edited/truncated after the fifth field in every record, which
          >all have common removal start/end points.
          >
          >We need to remove all info after the 5th field, normally the 4 digit
          >postcodes starting with "3***" to the end of line, ^P character. Some
          >postcode fields may be empty but will be evaluated & removed manually,
          >so their 'emptiness' is irrelevant.
          >
          >Example lines below are representative selection from the CSV.
          >
          >E.g. remove from (inclusive) comma :
          > ,"93973084","A","F","","41.65","641.65"
          >(as seen in first csv record below)
          >
          >"KOVACEK","MRS P KOVACEK","39 SMITH ROAD","SMITHVILLE VIC","3146","93973084","A","F","","41.65","641.65"
          >"KOVACS","MISS Z. KOVACS","UNIT 8/729 SMYTHE RD","MALVERN WEST","3145","98850813","","F","","96.81","496.82"
          >"KOTTKIN","MRS KOTTKIN","","","","95717114","BUS # 95291775","F","","93.93","3293.93"


          Happy Clip'n!
          Jody

          All Lists: http://www.fookes.us/maillist.htm
          Subscribe: mailto:ntb-Clips-Subscribe@yahoogroups.com
          UnSubscribe: mailto:ntb-Clips-UnSubscribe@yahoogroups.com
          Options: http://groups.yahoo.com/group/ntb-clips
          http://www.clean-funnies.com, http://www.sojourner.us/software
        • Howard Grimsdale
          Hi Jody, thank you for all your work - it was... is - worked perfectly! My son will use the library for many other unexpected tasks as well. 6386 records are
          Message 4 of 5 , Mar 26, 2005
          • 0 Attachment
            Hi Jody,

            thank you for all your work - it was... is - worked perfectly!
            My son will use the library for many other unexpected tasks as well.
            6386 records are wa-a-a-y too many to do manually, which he had started.

            Kind regards - Howard


            > You want the Delete Field... Clip in the Library below
            > [deletia... ]
            --
            Howard Grimsdale
            howard_g@...
          • Howard Grimsdale
            Hi ALan, thanks for your ideas. I shall try them in the a.m., all contributions are welcome as I have disprate things to be done on these CSV s Kind regards
            Message 5 of 5 , Mar 26, 2005
            • 0 Attachment
              Hi ALan,

              thanks for your ideas. I shall try them in the a.m., all contributions
              are welcome as I have disprate things to be done on these CSV's

              Kind regards - H

              > Hi Howard,
              >
              > I just wrote the next off the top of my head. The getfield or getfields

              [deletia ...}
              --
              Howard Grimsdale
              howard_g@...
            Your message has been successfully submitted and would be delivered to recipients shortly.