Click here to Skip to main content
15,895,746 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
someone please help me
I want to create software with the workings. my software open a file and read the contents therein, if the my software find a certain word in it then it will execute certain commands.
how do i make it
please help me
sorry if my english is bad because i'm from indonesia
Posted
Comments
Mohibur Rashid 10-Jul-11 1:52am    
Dude,
This seems way over your head.......................

you would have to clearly define how those certain command will be stored in your file or if it is predefined you will have to understand them how you can extract the command and understand the certain command.

Even If it is the simplest command I must say you will have to go through parsing.
Mohibur Rashid 10-Jul-11 1:52am    
"I said way over your head" just because, i think you are still young in programming for nothing else. it is possible to do. even dumb like me can do :))

First, you need to learn how to use google.

Next, here's a link I found when I googled "MFC open text file":

http://www.ucancode.net/faq/CFile-MFC-Example-Open-Write-Create.htm[^]
 
Share this answer
 
Comments
Member 8037386 7-Jul-11 23:46pm    
I already know how to open and write text files, which I do not know how to read a string in a text file and execute certain commands
standard library - fstream.
Or Win32 API CreateFile, WriteFile
 
Share this answer
 
Do some research on a substring command.
You need to check each line for a specific character / group of characters and then read the next x characters or read until another pattern is matched e.g. if the commands you are looking for could begin with then you search for

How you do this is a question of design. Assuming one useful command per line, then you can left trim everything before the command and right trim to get rid of everything after it. Whats left is your usable command.

If there are multiple commands per line then you will have to tackle SubStr.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900