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

8241RE: [Clip] What command for Count Occurences?

Expand Messages
  • Martyn Folkes
    Mar 1, 2002
    • 0 Attachment
      This should do what you want (it is 3 lines):

      ^!Set %string%=^?{String to count}; %filename%=^?{(T=O)Filename}
      ^!Set %count%=^$StrCount("^%string%";"^$GetFileText("^%filename%")$";N;N)$
      ^!Prompt There are ^%count% occurences of your search string.

      If you only want to spit the file into 2, it may be easiest to open the file
      and cut and paste half of it into a new file.

      Martyn


      > -----Original Message-----
      > From: bobbit_singapore [mailto:dick.gascoigne@...]
      > Sent: 01 March 2002 07:25
      > To: ntb-clips@yahoogroups.com
      > Subject: [Clip] What command for Count Occurences?
      >
      >
      > Using NoteTab Pro 4.86d:
      >
      > I have fairly large files (30 - 100 MB; 500K - 1,500K lines), which
      > ontain multiple occurrences of a string. I would like to know the
      > number of occurrences, using a clip. The Replace command does not
      > have a "Count Occurrences" option. What command(s) should I use?
      >
      > BTW:
      > The String I'm searchin for represents the header line which starts a
      > new document, of which there are several thousand in a file. My end
      > objective is to divide the file into 'N' files, each with an
      > approximately equal number of documents. IE: if the count is 8,200
      > documents, and 'N' = 2, I want to wind up with two files of 4,100
      > documents each. Is there a best way in NTB to do this, or should I
      > be looking at another tool?
      >
      > Best Regards,
      >
      > Dick Gascoigne
      > dick.gascoigne@...
      > --
      > Appic (S) Pte Ltd
      > 74A Amoy Street; Singapore 069893
      > Tel: (+65) 225-9908 Fax: (+65) 225-9092
      > Email: dick.gascoigne@...
      > Web: www.appic.com
      >
      >
      >
      >
      >
      >
      >
      >
      > Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
      >
      >
      >
    • Show all 4 messages in this topic