I have multiple kml files, each containing hundreds of placemarks. I suspect that I accidentally deleted a few placemarks. Since there are too many placemarks, it's not possible form me to count them altogether. So, is there any way to know the number of placemarks in a kml file?
Try using Notepad++, a powerful text editor. I use it for a lot of my KML editing, and it has some powerful find/replace tools. These include a "count" function that will let you count the instances of a certain string (eg: "
<Placemark"). The Find dialog also includes a "Find in Files" tab, which will allow you to find a string across all files in a directory. While that doesn't have a "count" button, its output includes a count of the total number of instances across all files.
Notepad++ is Windows only, so if you're on another platform you can find similar functionality in something like jEdit, or another advanced text editor.
Since you did not specify which program you want to use, here is a solution using QGIS:
Load the files in QGIS and then right-click on each layer in the Layers Panel and activate the option "Show Feature Count". Now the total number of features in each layer is shown in brackets behind the layer name.