How To - Copy each item in a list to another database (RPA - Python)

59 views Asked by At

What I want to do: Turn a csv file into a list and copy each of those item and paste somewhere else.

Why: Wanna a RPA script to do that for me.

My problem: My csv file might have different count of rows. When I use pyperclip to copy an item, I can only copy using the index position, not a list. Need to copy each of those timecodes and paste, one by one, considering every possible list range.

My lists Output:

['00;00;00;00', '00;54;09;29']
['00;54;09;28', '00;54;45;03']
[nan, 'CRD']

My code:

decupagem = pd.read_csv('6353832.csv', encoding='UTF-16', sep='\t')
decupagem[['In','Out','Description']] 


tamanho_in = len(decupagem.In)
tamanho_out = len(decupagem.Out)
tamanho_comentario = len(decupagem.Description)

#turning csv into list

entrada = decupagem.In.tolist()[0:tamanho_out]
print (entrada)

saida = decupagem.Out.tolist()[0:tamanho_in]
print(saida)

comentario = decupagem.Description.tolist()[0:tamanho_comentario]
print(comentario)

for tc in entrada:
    
    pyperclip.copy(entrada[0:tamanho_in])
    pyperclip.paste(entrada)

Some help, please? Thanks!

0

There are 0 answers