I have this Table which I am trying to transform by removing all the elements that are smaller than -5 and larger than 5 from the rows but not including the first element in each row (not sure that makes sense).
test = Table[Flatten[{i, Table[j, {j, -10, 10, 1}]}], {i, 1, 10}] I would like to end up with what is equivalent to this:
Table[Flatten[{i, Table[j, {j, -5, 5, 1}]}], {i, 1, 10}] Obviously the table is not that simple and it is not generated like this. It is imported from a file and I am trying to prune.
I tried this:
test[[All, 2 ;; Length[test[[1]]]]] = Table[Select[test[[i, 2 ;; Length[test[[1]]]]], -5 <= # <= 5 &], {i, 1, Length[test]}] But it gives the wrong result. I am sure I am on the right path I just can't see it!
Edit: here is a link to the actual data file.
Then thing is when I apply the solution proposed by @Syed I end up with an uneven Table. The rows do not have the same length anymore. I am trying to figure out what to do
The solution is good for the problem I asked! Thank you, the problem is my data is weirder than I thought.