I'm importing some data from a file. However, the file was created by an unreliable instrument, such that the data looks like this:
in: data = Import["D:\\6000s.txt", "Table"]
out: {...{5,0,46.4109},{6,0,46.6017},{7,0,No,Data},{8,0,45.7324}...}
The lines containing "No Data" can be safely deleted, but I don't know how to do this well. How can I efficiently map over my table and erase all rows that contain a string?
Thanks in advance for your help.
Edit: An example of my data is here . Also, a closely related question is here
Edit 2: @RunnyKine's and @MikeHoneyChurch's answers in the comments did the trick. I ended up doing the following:
data = Import["my_data.txt", "Table"];
data = DeleteCases[data, {__, _String, _String}]
This is much faster than the ugly for loops I had used previously. Thanks for your help!
Import
might be available. $\endgroup$DeleteCases[yourData,{__,No Data}]
and replace No Data with what is present e.g. a Null, empty string ... $\endgroup${__, No Data}
instead it should beDeleteCases[data, {__, No, Data}
or justDeleteCases[data, {__, No, _}]
$\endgroup$