Is this code efficient for file parsing?
ofstream outfile;


Why is this declared global? The variable is only used in writedata. Declare it in this scope.
ofstream out;


What is the purpose of this stream? It is opened (multiple times!) in the code but never written to.
string tmp;
string data;
string filename;
string name;
size_t found;


You should declare objects in the narrowest scope that they need to exist, instead of the function head.
while (input &gt;&gt; line)


The operator &gt;&gt; will read one word at a time, not a whole line. If you want to read whole lines, you should use while(std::getline(input, line)).
found = line.find_last_of("pmf");


I think this doesn't do what you expect it to do. It finds the position of the last character in line which is equal to either of the single characters in "pmf". You probably want to use line.rfind("pmf") instead, which returns the position of the last occurrence of the full string "pmf".

Looking at your example file however I believe you actually want to check whether the beginning of the line is "pmf" (consider the work string might include "pmf"), so you would use line.find("pmf") and check it against 0 instead of string::npos. 
name = line.substr(found + 1, line.length());
filename = line.substr(found + 1, line.length());


These two strings are the same? Why? In the following code they are used interchangeable, so stick to one and remove the other. Even if they were used differently you could still use filename = name.

Also you are trying to get a substring of the same length as the whole line (the second argument to substr is the length of the substring to be extracted), which obviously doesn't work. However substr truncates in this case such that a substring ending at the end of the input string is returned.

The supposed filename you are extracting should be the part after pmf in pmfwork1. However you start the substring one position after the position of the last occurrence of pmf, which would be result in "mf" being part of the string. However with the particular example file you provided and in combination with the semantic error I laid out in 5., you actually get the expected result. Here two errors cancel each other. For different input however you would have very unexpected results.
for (it = MyFileMap.begin(); it != MyFileMap.end(); ++it)
    if (name.compare(it-&gt;first) == 0)


The whole purpose of a map is to be able to access the values via a key instead of iterating over them. You should use this functionality:

auto it = MyFileMap.find(name);
if(it != MyFileMap.end())
    // "name" found it is at "it"
else
    // "name" is not in "MyFileMap"!

while (input &gt;&gt; tmp &amp;&amp; tmp.compare("pme"))


Again the input is one word each instead of lines. Data which includes the word "pme" would trigger the end.
if (it == MyFileMap.end() || MyFileMap.empty())


The second condition is redundant. If MyFileMap.empty() is true, then also it == MyFileMap.begin() == MyFileMap.end() at this point.
cout &lt;&lt; "Data push " &lt;&lt; data &lt;&lt; " to " &lt;&lt; it-&gt;second &lt;&lt; endl;


Here you try to dereference it, which you previously checked to be MyFileMap.end(). Dereferencing the end() iterator invokes undefined behaviour. Since I guess these lines are debug output only anyway, just remove that part.
MyFileMap[name] = filename;
for (it = MyFileMap.begin(); it != MyFileMap.end(); ++it)
{
    if (name.compare(it-&gt;first) == 0)
    {
        writedata(data, it-&gt;second);
        data.clear();
        break;
    }
}


What is the purpose of this loop? You just inserted the key name into the map and now you search it again. Why not simply access it directly:

MyFileMap[name] = filename;
writedata(data, MyFileMap[name]);
data.clear();


Note however that this is the same as, but in general slower than:

MyFileMap[name] = filename;
writedata(data, filename);
data.clear();

system("pause");


In order to use std::system you need to #include&lt;cstdlib&gt;.
What is the purpose of the MyFileMap at all? It stores the names as keys and filenames as values. The only difference between the two is that filename has an ".txt" added. Why do you need to save this? You can append the ".txt" each time you have a new name. This would be much easier to read and much faster.
If you are trying to minimize the number of open calls you might want to store all the opened ofstreams in the map and access them as you need them, closing all at the end of the function. Notice however that ofstream is not copyable, so you need to store references to them in the map, instead of the objects themself.

If the input files are not that big, you might also consider saving all the parsed data in memory first and then writing it to the output files in one go. While parsing you can use a string-string map to save the data for each file.
You are lacking any check of syntax errors in the input file. You probably should add code that reports back if the syntax is not as expected instead.


In summary:

Your code will likely not do what you expect it to do in many cases. You should generate more diverse test cases. (try pmfworkm instead of pmfwork1 in your example file and report what happens).

Several parts of the code are redundant (all the map-iterating loops) and at the same time they might be very time costly for large input files (since the map might grow rapidly).