OBTENER NÚMERO DE LÍNEAS DE n FICHEROS [APUNTES]
When we make many models of distribution, an important detail is the number of available presence records for each species. Our goal is to get a table with the name and number of occurrences of each species. Assuming
files with records of presence does not have any headers, and are stored all in the same directory, these are the necessary commands: cd
directorio_presencias
for species in *; do
lines = `wc-l $ species
` echo $ species >> / path / fichero_salida.txt
done
fichero_salida.txt
The result, which has a format like this,
508 Adenocarpus_gibbsianus
7 Alchemilla_fontqueri
Allium_pruinatum
356 132 313 Anthemis_bourgaei
Antirrhinum_charidemi
1 Aquilegia_cazorlensis
in the name of each species is preceded by the number presence records.
0 comments:
Post a Comment