Let's say I have a file(.txt) with:
footest_footest1
footest_footest2
footest_footest3
bartest_bartest1
bartest_bartest2
cartest_cartest1
cartest_cartest2
cartest_cartest3
Using python, how could I aggregate events to the first underscore so it prints:
footest
bartest
cartest
Thanks in advance
Aucun commentaire:
Enregistrer un commentaire