Search found 13 matches

by kmbarre
31 Jul 2012 12:21
Forum: DOS Batch Forum
Topic: Count string occurrences in text file
Replies: 43
Views: 40632

Re: Count string occurrences in text file

Sorry. Not & but $. My actual search string is not a $ but using it as an example
by kmbarre
31 Jul 2012 12:20
Forum: DOS Batch Forum
Topic: Count string occurrences in text file
Replies: 43
Views: 40632

Re: Count string occurrences in text file

nope. no line breaks. I've looked at he files with a hex editor and found nothing. For all files, regardless of size, they contain only one line. no CR or LF.
by kmbarre
31 Jul 2012 11:29
Forum: DOS Batch Forum
Topic: Count string occurrences in text file
Replies: 43
Views: 40632

Re: Count string occurrences in text file

I'm not familar with SED so I'm looking at their site for some more insight on the switches. I'm curious as to the \ before the search string
eg. sed "s/\&/n\/g" . . . . .
by kmbarre
31 Jul 2012 11:25
Forum: DOS Batch Forum
Topic: Count string occurrences in text file
Replies: 43
Views: 40632

Re: Count string occurrences in text file

I've done that. :( I opened up the file in ultra edit and did a search -> find -> count for the string. there is one less than what my script is reporting. It may be that this script adds one too many line breaks.
by kmbarre
31 Jul 2012 10:45
Forum: DOS Batch Forum
Topic: Count string occurrences in text file
Replies: 43
Views: 40632

Re: Count string occurrences in text file

Yes I understand what it is doing. Its the syntax that is a bit confusing. This is a support forum, is it not?
by kmbarre
31 Jul 2012 08:43
Forum: DOS Batch Forum
Topic: Count string occurrences in text file
Replies: 43
Views: 40632

Re: Count string occurrences in text file

Well my intent is to count the number of times a string occurs in each file. So what might I check or change to remove this extra count?
by kmbarre
31 Jul 2012 08:12
Forum: DOS Batch Forum
Topic: Count string occurrences in text file
Replies: 43
Views: 40632

Re: Count string occurrences in text file

No luck. No blank lines. one file actually is just one short line with none of the search string text in it. And still shows up as one.
by kmbarre
31 Jul 2012 07:46
Forum: DOS Batch Forum
Topic: Count string occurrences in text file
Replies: 43
Views: 40632

Re: Count string occurrences in text file

One thing I just noticed is that this script adds 1 to the count for each file. For example, I'm expecting 25000 and it is giving me 25001.

Any thoughts?
by kmbarre
30 Jul 2012 14:02
Forum: DOS Batch Forum
Topic: Count string occurrences in text file
Replies: 43
Views: 40632

Re: Count string occurrences in text file

ok Got it! And the scrpt works GREAT!! Thank you!

One last question. Is there a way I could put the script files in a subdirectory of the one I am searching? Wonder what sytax in the scripts would need to change?
by kmbarre
30 Jul 2012 13:38
Forum: DOS Batch Forum
Topic: Count string occurrences in text file
Replies: 43
Views: 40632

Re: Count string occurrences in text file

Do you have a good link for GnuSED?
by kmbarre
30 Jul 2012 10:59
Forum: DOS Batch Forum
Topic: Count string occurrences in text file
Replies: 43
Views: 40632

Re: Count string occurrences in text file

The purpose is to confirm the number of records in the file. I am searching for the delimiter. For example, a "$", which seperates each record. I've got it working for one file as I update the script for each indivdual file I want to scan. But what I'dl like to do is have it display what f...
by kmbarre
30 Jul 2012 08:47
Forum: DOS Batch Forum
Topic: Count string occurrences in text file
Replies: 43
Views: 40632

Re: Count string occurrences in text file

The files are 25 MB and contain 25000 records but there are no carriage returns so it is all one line.
by kmbarre
30 Jul 2012 07:15
Forum: DOS Batch Forum
Topic: Count string occurrences in text file
Replies: 43
Views: 40632

Re: Count string occurrences in text file

I know this is a really old thread. I've tried this and it works great. I was wonder how I might get it to loop through a series of files in a directory. I've tried the find dos command, but the problem is my files are very large and consist of one line. So the find command does not work as it count...