So I have a .txt file looking like this:
1:Meat Dish:Steak:11.5
2:Fish Dish:Fish and chips:12
The first number is the itemNo, 'Meat Dish' is my category, 'Steak' is my description and finally '11.5' is my price.  
So basically I want to search for the itemNo and I want it to display the price from that line. This is what I have until now:
#include <iostream>
#include <fstream>
#include <string>
#include <vector> // We will use this to store Players
using std::string;
using std::ofstream; 
using std::ifstream; 
using std::cout;
using std::cin;
struct MenuList // Define a "Player" data structure
{
    string itemNo;
    string category;
    string descript;
    double price;
};
std::istream& operator>>(std::istream& infile, MenuList& menu)
{
    // In this function we will define how information is inputted into the player struct
    // std::cin is derived from the istream class
    getline(infile, menu.itemNo, ':'); 
    getline(infile, menu.category, ':');
    getline(infile, menu.descript, ':');
    infile >> menu.price;
    // When we have extracted all of our information, return the stream
    return infile;
}
std::ostream& operator<<(std::ostream& os, MenuList& menu)
{
    // Just like the istream, we define how a player struct is displayed when using std::cout
    os << "" << menu.itemNo << " " << menu.category << " - " << menu.descript;
    // When we have extracted all of our information, return the stream
    return os;
}
void Load(std::vector<MenuList>& r, string filename) 
{
    std::ifstream ifs(filename.c_str()); // Open the file name
    if(ifs)
    {
        while(ifs.good()) // While contents are left to be extracted
        {
            MenuList temp;
            ifs >> temp;        // Extract record into a temp object
            r.push_back(temp);  // Copy it to the record database
        }
        cout << "Read " << r.size() << " records.\n\n"; 
    }
    else
    {
        cout << "Could not open file.\n\n";
    }
}
void Read(std::vector<MenuList>& r) // Read record contents
{
    for(unsigned int i = 0; i < r.size(); i++)
        cout << r[i] << "\n";
}
void Search(std::vector<MenuList>& r) // Search records for name
{
    string n;
    cout << "Search for: ";
    cin >> n;
    for(int i = 0; i < r.size(); i++)
    {
        if(r[i].itemNo.find(n) != string::npos)
            cout << r[i];
    }
}
int main()
{
    std::vector<MenuList> records;
    Load(records, "delete.txt");
    Read(records);
    Search(records);
    return 0;
}
I don't really know how to make it so it shows just the price without showing the whole line.
 
    