How to read file from specific word in php?

Read word from text file.

  • Hi ! Im creating program that will read one word from the text file. The word i want my program to read is PROFILE. I am beginer so I dont know much about C++ programing. I realy need help because I almost finished my program, I just need this bit of code. The file with word PROFILE in it will be named profile.txt.

  • Answer:

    Hello Krystian I could help you more if I knew what the profile.txt looked like and what you needed to do once the word PROFILE was found. For now I can give you the sample code below to show you how to open a file, read it's lines, and search for a line that starts with PROFILE. I hope that helps you. Let me know if there is something in the program that you don't understand. using namespace std; void readFromFile(void) { // open the file and check that it was found ifstream in("profile.txt"); if ( ! in.good()) { cout } int main(void) { readFromFile(); }

Miningco.com Visit the source

Was this solution helpful to you?

Related Q & A:

Just Added Q & A:

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.