Write list to new column in existent csv

Tal Bar-Or tbaror at gmail.com
Fri Oct 17 12:56:17 EDT 2014


Hello Group,

I am tryin to figure how to write a list i have as follows

['info', '19987→445 [SYN] Seq=0 Win=8192 Len=0 MSS=1460 WS=256 SACK_PERM=1\n', '445→19987 [SYN, ACK] Seq=0 Ack=1 Win=65535 Len=0 MSS=1460 WS=64 SACK_PERM=1\n', '19987→445 [ACK] Seq=1 Ack=1 Win=65536 Len=0\n', 'Negotiate Protocol Request\n', '[TCP Retransmission] Negotiate Protocol Request\n', '445→19987 [ACK] Seq=1 Ack=160 Win=1049536 Len=0\n', 'Negotiate Protocol Response\n', 'Negotiate Protocol Request\n', 'Negotiate Protocol Response\n', 'Session Setup Request, NTLMSSP_NEGOTIATE\n', 'Session Setup Response, Error: STATUS_MORE_PROCESSING_REQUIRED, NTLMSSP_CHALLENGE\n', 'Session Setup Request, NTLMSSP_AUTH, User: GEFEN\\tbaror\n', '445→19987 [ACK] Seq=768 Ack=1016 Win=1049728 Len=0\n', 'Session Setup Response\n', 'Tree Connect Request Tree: \\\\media.isilon.gefen.local\\Media\n', 'Tree Connect Response\n', 'Create Request File: New Text document.txt\n', 'Create Response File: New Text document.txt\n', 'GetInfo Request FS_INFO/SMB2_FS_INFO_01 File: New Text document.txt;GetInfo Request FS_INFO/SMB2_FS_INFO_05 File: New Text document.txt\n']


To a a csv to for example the 3rd column , i am really got stacked here i tried few codes with csv.writerow() but didn't got it work ,will really appreciate if someone could help me with that
Please advice
Thanks

The csv
ip.src,ip.dst,smb.file,smb2.filename,smb.path,smb2.tree,smb.time,smb2.time,smb.cmd,smb2.cmd,tcp.time_delta,tcp.analysis.ack_rtt,tcp.analysis.ack_lost_segment,tcp.analysis.duplicate_ack,tcp.analysis.lost_segment,tcp.analysis.retransmission,tcp.analysis.out_of_order,tcp.analysis.window_full,tcp.analysis.window_update,tcp.analysis.zero_window
172.18.2.54,172.18.5.64,,,,,,,,,0,,,,,,,,,
172.18.5.64,172.18.2.54,,,,,,,,,0.003322,0.003322,,,,,,,,
172.18.2.54,172.18.5.64,,,,,,,,,0.000029,0.000029,,,,,,,,
172.18.2.54,172.18.5.64,,,,,,,114,,0.000084,,,,,,,,,
172.18.2.54,172.18.5.64,,,,,,,114,,0.300507,,,,,1,,,,
172.18.5.64,172.18.2.54,,,,,,,,,0.000114,0.300621,,,,,,,,
172.18.5.64,172.18.2.54,,,,,,,,0,0.000266,,,,,,,,,
172.18.2.54,172.18.5.64,,,,,,,,0,0.000092,0.000092,,,,,,,,
172.18.5.64,172.18.2.54,,,,,,0.000192,,0,0.000192,0.000192,,,,,,,,
172.18.2.54,172.18.5.64,,,,,,,,1,0.000589,0.000589,,,,,,,,
172.18.5.64,172.18.2.54,,,,,,0.001788,,1,0.001788,0.001788,,,,,,,,
172.18.2.54,172.18.5.64,,,,,,,,1,0.000193,0.000193,,,,,,,,
172.18.5.64,172.18.2.54,,,,,,,,,0.005582,0.005582,,,,,,,,
172.18.5.64,172.18.2.54,,,,,,0.008014,,1,0.002432,,,,,,,,,
172.18.2.54,172.18.5.64,,,,\\media.isilon.gefen.local\Media,,,,3,0.000203,0.000203,,,,,,,,
172.18.5.64,172.18.2.54,,,,,,0.000458,,3,0.000458,0.000458,,,,,,,,
172.18.2.54,172.18.5.64,,New Text document.txt,,\\media.isilon.gefen.local\Media,,,,5,0.000189,0.000189,,,,,,,,
172.18.5.64,172.18.2.54,,,,\\media.isilon.gefen.local\Media,,0.000274,,5,0.000274,0.000274,,,,,,,,




More information about the Python-list mailing list