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

Clip to "chunk" one large text file to multiple files

Expand Messages
  • Scott McDonald
    I m a long-time NoteTab Pro user but a clip neophyte. So excuse me if I explain this request in non-programmer terms. I m looking for a clip that will process
    Message 1 of 2 , Dec 6, 2003
    • 0 Attachment
      I'm a long-time NoteTab Pro user but a clip neophyte. So excuse me
      if I
      explain this request in non-programmer terms.

      I'm looking for a clip that will process a large text file, chunking
      the file according to rules and writing these chunks to new files. I
      can add structure to this text file with unique text strings, so
      that the clip would look for an opening string, go into "select"
      mode, look for the closing string, and then write the selected text
      to a generic filename that increments by one. Any script that's a
      close variation on this theme would be helpful in orienting me.

      I've been told to use Perl to do this kind of operation, but if
      NoteTab Pro can do this I'd just as soon stay with something
      familiar.

      Thanks in advance,

      Scott
    • Jody
      Hi Scott, ... Read the recent thread at: http://groups.yahoo.com/group/ntb-clips/messages posted by me: RE: [Clip] Database Spit Clip 02 Dec 2003 First line of
      Message 2 of 2 , Dec 6, 2003
      • 0 Attachment
        Hi Scott,

        >I'm looking for a clip that will process a large text file,
        >chunking the file according to rules and writing these chunks to
        >new files. I can add structure to this text file with unique text
        >strings, so that the clip would look for an opening string, go
        >into "select" mode, look for the closing string, and then write
        >the selected text to a generic filename that increments by one.
        >Any script that's a close variation on this theme would be
        >helpful in orienting me.

        Read the recent thread at: http://groups.yahoo.com/group/ntb-clips/messages
        posted by me:

        RE: [Clip] Database Spit Clip
        02 Dec 2003
        First line of a post: Splits files at given line, that has a finished
        script, but there is another prior that uses Save As instead of TextToFile.

        Then, edit so that you use what you are requesting...

        :Loop
        ^!Find "<tag>" S
        ^!IfError End
        ^!Jump Select_End
        ^!Set %Start%=^$GetRow$:^$GetCol$
        ^!Find "</tag>" S
        ^!Jump Select_Start
        ^!SelectTo ^%Start%
        ; Enter the ^!SetClipboard ^!Toolbar Paste New,
        ; ^!Save As, ^!SetDocIndex etc. or ^!TextToFile data here
        ^!Inc %n%
        ^!Jump +1
        ^!Goto Loop

        Note: if there is a label already called Loop, you'll need
        to name this or the other something else. I like using Loop1,
        Loop2, etc. myself, but sometimes enter a descriptive name
        like :ReStart, :EndLineLoop, :Convert2HTMLLoop, and so on...

        Happy Clip'n!
        Jody

        www.clean-funnies.com, 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
      Your message has been successfully submitted and would be delivered to recipients shortly.