ListPlot
of the absolute value of Fourier
on the two signals shows some regularity for the "good" signal that is not so obvious in the bad one. So a possibility is as follows. Important: This relies on them having the same length. Else the idea can be made to work but will require some adjustments.
Take the Fourier transform of the good signal.
Construct a mask for frequencies that have large amplitudes.
Apply this mask on the FT of the noisy signal.
Use the IFT of that masked signal.
Here is code I used. I first downloaded the files to my /tmp directory.
iin = Import["/tmp/inside.txt", "CSV"];
sigin = iin[[1]];
fin = Fourier[sigin];
fin2 = Map[If[Abs[#] > 40, #, 0] &, fin];
mask = Sign[Abs[fin2]];
iout = Import["/tmp/outside.txt", "CSV"];
sigout = iout[[1]];
fout = Fourier[sigout];
fout2 = mask*sigout;
out2 = Re[InverseFourier[fout2]];
I don't know if this will do what you want but it might give some ideas.