943,682 Members | Top Members by Rank

Ad:
Aug 5th, 2004
0

String search in a file compare?

Expand Post »
Hi ya,
I looked up "fc" and "for" in DOS commands but unable to find the solution I desired.

I would want to edit a command into a .bat file that could search a particular field in a line (the line might be of different sequence order) in a .dat file (could be opened up to read as a text file) and compare with another .dat file.

For example, the .dat file would looks something like this :
UsageCounter158555
ConsecutiveCounter0999
AccessoryCounter157333

Any kind soul out there knows if there any DOS command or how am I able to, say compare the "999" field of ConsecutiveCounter between 2 such .dat files and possibly have a return value like 1 or 0 to indicate if the search is successful?
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
Kimmi is offline Offline
17 posts
since Jul 2004
Aug 7th, 2004
0

Re: String search in a file compare?

That's a toughie. On Windows, in a command prompt type "help for", that seems like its close to what you want (it can parse each line of an input file and do something with the tokens of that line).

A simple C++ program might be easier, though.
Reputation Points: 36
Solved Threads: 11
Posting Pro in Training
Chainsaw is offline Offline
436 posts
since Jun 2004

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Computer Science Forum Timeline: i want to know how to create a file maintenance using visual basic 6.0
Next Thread in Computer Science Forum Timeline: Dr Scheme example





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC