I'm working on a project of Nuclear physics and I'm passing results of a simulation program to mathematica via a txt file. I then read the values I need to read and plot them. The problem is that sometimes those values don't appear on the file, and then mathematica gets an "end of file" error instead of a value when I try to find them. Everything works fine with the plot, but if I want to show the results on a table it's all messed up and filled with errors.
TL;DR
How do I remove all the errors from a list like this:
{{40.,Internal`StringToDouble[StringSplit[EndOfFile][[6]]]},
{45.45,Internal`StringToDouble[StringSplit[EndOfFile][[6]]]},{50.91,49.5},
{56.36,78.9},{61.82,70.9},{67.27,32.6},{72.73,9.4},{78.18,3.9},{83.64,1.1},
{89.09,0.2},{94.55,0.1},{100.,Internal`StringToDouble[StringSplit[EndOfFile][[6]]]}}
replacing them with zeros?
I want to get something like this:
{{40.,0},{45.45,0},{50.91,49.5},{56.36,78.9},{61.82,70.9},{67.27,32.6},
{72.73,9.4},{78.18,3.9},{83.64,1.1},{89.09,0.2},{94.55,0.1},{100.,0}}
Thanks and sorry for the messy question.
Replace[YourList, x_ /; Not@NumericQ@x :> 0, {2}]
$\endgroup$