+ 1

how to sort a text file based on column

I have a text file. It has 192.168.10.0/34, 22, 63355 172.156.34.20/8, 20, 21 10.148.172.31/16, 18, 22 I would like to sort it cloumn wise,so that cloumn[0] sould only has a list of ip address and column[1] should have ports and column[3] will have port. Here delimeter is comma(,) def ip_list(ip): ....... return ip

31st Aug 2017, 1:18 AM
dkhode
dkhode  - avatar
1 Respuesta