User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the Computer Science and Software Design section within the Software Development category of DaniWeb, a massive community of 456,469 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,813 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our Computer Science and Software Design advertiser: Programming Forums
Views: 6587 | Replies: 1
Reply
Join Date: Jul 2004
Posts: 17
Reputation: Kimmi is an unknown quantity at this point 
Rep Power: 5
Solved Threads: 0
Kimmi Kimmi is offline Offline
Newbie Poster

Help String search in a file compare?

  #1  
Aug 5th, 2004
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?
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Jun 2004
Location: Marin, CA, USA
Posts: 434
Reputation: Chainsaw is an unknown quantity at this point 
Rep Power: 5
Solved Threads: 10
Chainsaw's Avatar
Chainsaw Chainsaw is offline Offline
Unprevaricator

Re: String search in a file compare?

  #2  
Aug 7th, 2004
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.
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

DaniWeb Computer Science and Software Design Marketplace
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes

Similar Threads
Other Threads in the Computer Science and Software Design Forum

All times are GMT -4. The time now is 2:25 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC