GabiS
(usa Ubuntu)
Enviado em 11/02/2021 - 10:47h
Olá pessoal, estou tentando desenvolver um script para ler um arquivo como no exemplo a abaixo:
calculate_information_gain,1807383503.4045517,3256.28,94543.0,None,0
calculate_information_gain,1607383503.4113085,3221925,91003.0,None,0
calculate_information_gain,1807383503.4179888,3189489,91553.0,None,0
majorite_vote,1607383503.4113085,3221925,91003.0,None,0
majorite_vote,1907383503.4179888,3189489,91553.0,None,0
Fit,1607383503.4113085,3221925,91003.0,None,0
Fit,1607383503.4179888,3189489,91553.0,None,0
calculate_information_gain,1607383503.4113085,3221925,91003.0,None,0
calculate_information_gain,1807383503.4179888,3189489,91553.0,None,0
Eu gostaria de ler linha por linha e separar cada linha em arquivos diferentes pelo nome que está no primeiro campo, assim:
arquivo1.dat
calculate_information_gain,1807383503.4045517,3256.28,94543.0,None,0
calculate_information_gain,1607383503.4113085,3221925,91003.0,None,0
calculate_information_gain,1807383503.4179888,3189489,91553.0,None,0
calculate_information_gain,1607383503.4113085,3221925,91003.0,None,0
calculate_information_gain,1807383503.4179888,3189489,91553.0,None,0
arquivo2.dat
majorite_vote,1607383503.4113085,3221925,91003.0,None,0
majorite_vote,1907383503.4179888,3189489,91553.0,None,0
arquivo3.dat
Fit,1607383503.4113085,3221925,91003.0,None,0
Fit,1607383503.4179888,3189489,91553.0,None,0
Alguém poderia me ajudar?