Removing selective data from a variable

thanks lost i was about to go on the same direction :thumb: