Mishkat al-Masabih
Anas told that when the Prophet (ﷺ) was brought some old dates he began to examine them and remove the worms from them. Abu Dawud transmitted it.
وَعَن أَنَسٍ قَالَ: أَتَى النَّبِيُّ صَلَّى اللَّهُ عَلَيْهِ وَسَلَّمَ بِتَمْرٍ عَتِيقٍ فَجَعَلَ يُفَتِّشُهُ وَيُخْرِجُ السُّوسَ مِنْهُ. رَوَاهُ أَبُو دَاوُد
Reference