Код: Выделить всё
6802496011442316593 1625090609 51048468525236 aaa=1111|bbbb=15|cccc=216|dddd=1625090604|eeee=5|ffff=12000|ggg=brtnrn=|hhhh=4|ii=lfp|ts=1625090609
6802496011442316593 1625090609 51048468525236 aaa=1111|bbbb=15|cccc=216|dddd=1625090604|eeee=5|ffff=12000|ggg=brtnrn=|hhhh=4|ii=lfp|ts=1625090489
6802496011442316593 1625090609 51048468525236 aaa=1111|bbbb=15|cccc=216|dddd=1625090604|eeee=5|ffff=12000|ggg=brtnrn=|hhhh=4|ii=lfp|ts=1625090549
6802496011442316593 1625090609 51048468525236 aaa=1111|bbbb=15|cccc=216|dddd=1625090604|eeee=5|ffff=12000|ggg=brtnrn=|hhhh=4|ii=lfp|ts=1625090599
6802496011442316593 1625090609 51048468525236 aaa=1111|bbbb=15|cccc=216|dddd=1625090604|eeee=5|ffff=12000|ggg=brtnrn=|hhhh=4|ii=lfp|ts=1625090599
Код: Выделить всё
with open(inputt, "r") as f1:
for line in f1:
exp = line.split("\t")[3]
params = exp.split("|")
extraparamts = list()
for param in params:
if "ts=" in param:
extraparamts.append(param[3:-1])
print(extraparamts)
Код: Выделить всё
['1625090429']
['1625090489']
['1625090549']
['1625090599']
['1625090599']
Код: Выделить всё
1625090429
1625090489
1625090549
1625090599
1625090599
Код: Выделить всё
print(*tslist, sep=",")
Подробнее здесь: https://stackoverflow.com/questions/690 ... and-commas
Мобильная версия