How to access data in a separate save file?

Say the player finished a playthrough in file 2. They start a new game on file 3. How would I access information from file 2? If I wanted to get the name of a certain actor in file2 and set it as a variable in file3, how would I do that? I know there are new game+ plugins but I need to be able to filter which saves are being accessed for the new play-through so they don't work for what I am trying to do. I have Olivia_MetaControls to set global variables during each playthrough, but it would be simpler to just pull data straight from the saves without having to affect the others.
I don't think an existing solution exists, so you would most likely need to program this yourself. Since save files are compressed, you'd basically need to fully load another save, and then look through its data. If you're up to such a task, DataManager.loadGame is a good place to start.
If not, I'd suggest just using global data.
What you need is persistent variables, although that functions a bit different than you planned.

persistent variables set aside one save to store the variable or switch data for all variables and switches that are declared persistent there, and then make sure the values are the same over every game done.

you can then store any data (even strings) in those variables to access it in any game.
But YOU are the one who has to control the data there, like only storing it if a game is complete - and then if would be the same everywhere no matter if the second, third of fourth slot.
So you just need the name? In that case instead of messing with save files, when the game reaches completion, generate a text file containing their name somewhere like in the data folder. You can check for this file later and get the name inside when you need it. You can find these nodejs code snippets easily if you google.
By default the "global" save file contains info used for displaying per-save data on the in-game save/load screens: playtime, game title, party sprite names, etc (cf DataManager.makeSavefileInfo, rpg_managers.js).

A plugin could store the actor name in that per-save global data, e.g. (untested):
Spoiler: plugin code
JavaScript:
/*:
 * @target MV
 * @plugindesc Add name of actor 1 to save info.
 * @author Caethyril
 * @url https://forums.rpgmakerweb.com/threads/162990/
 * @help Free to use and/or modify for any project, no credit required.
 */
;void (function(alias) {
  DataManager.makeSavefileInfo = function() {
    // generate info as usual
    var info = alias.apply(this, arguments);
    // add new value - name of actor ID 1
    info.actor1Name = $gameActors.actor(1).name();
    return info;
  };
})(DataManager.makeSavefileInfo);
Then you should be able to read it via loadSavefileInfo, e.g. (untested):
JavaScript:
// save file ID
var id = 1;
// load save file info for that slot
var info = DataManager.loadSavefileInfo(id);
// get that save's actor1Name value, or a blank string if it's absent/falsy
var value = info ? info.actor1Name || "" : "";

[Edit: corrected var value line.]
I don't think an existing solution exists, so you would most likely need to program this yourself. Since save files are compressed, you'd basically need to fully load another save, and then look through its data. If you're up to such a task, DataManager.loadGame is a good place to start.
If not, I'd suggest just using global data.
Ah, I hadn't realized they were compressed. I don't know JS so I will just have to stick with the global variables. Which is fine, I know how to get them to work, it is just a lot of if/then trees at the start of the game 😅

What you need is persistent variables, although that functions a bit different than you planned.

persistent variables set aside one save to store the variable or switch data for all variables and switches that are declared persistent there, and then make sure the values are the same over every game done.

you can then store any data (even strings) in those variables to access it in any game.
But YOU are the one who has to control the data there, like only storing it if a game is complete - and then if would be the same everywhere no matter if the second, third of fourth slot.
That's what I have Olivia_MetaControls for 😂 This was my work-around, I was just seeing if anyone more knowledgeable than me might know of a way to do it with something similar to just... "Retrieve the name of actor1 in file 1" :3

So you just need the name? In that case instead of messing with save files, when the game reaches completion, generate a text file containing their name somewhere like in the data folder. You can check for this file later and get the name inside when you need it. You can find these nodejs code snippets easily if you google.
I will actually need more than the name, I was just using name as an example really. The plan is for it to do something like Dragon Age and/or Mass Effect where your choices affect the next game. Just with mine, the next game is the other path the player didn't choose in the first playthrough. And then the third(hidden) path that only opens when they use a game file that completed the other two paths.

Original thread: https://forums.rpgmakerweb.com/threads/how-to-access-data-in-a-separate-save-file.162990/