Ethereal-users: RE: [Ethereal-users] Trace File -> Excel Conversion

Note: This archive is from the project's previous web site, ethereal.com. This list is no longer active.

From: "McGlinchy, Alistair" <Alistair.McGlinchy@xxxxxxxxxxxxxxxxxxxxx>
Date: Mon, 3 Oct 2005 17:09:17 +0100
Lev,

> I have a .trace file which I can open and read by Ethereal. 
> What I need is to extract from this .trace file information 
> about time and frame size for each frame ant put this 
> information into Excel file. The resulting Excel table should 
> have two columns (time, frame size) and so many rows how many 
> frames in .trace file. 
> 
> How can I do it?

I do this via a Perl script to convert tethereal into CSV. 

tethereal -r trace.cap | perl eth2csv.pl > out.csv

Where eth2csv.pl is:

	while(<>) {
		s/^ *//;  # Remove any preceding spaces
		my @cols=(split / +/, $_ , 10); # split by muilti-spaces
		$cols[-1] =~ s/,/ /g; # remove any commas from the final
column decode
		print join ",", $frame++ ,@cols;
	}

Cheers

Alistair

**********************************************************************
Registered Office:
Marks and Spencer plc
Waterside House
35 North Wharf Road
London
W2 1NW

Registered No. 214436 in England and Wales.

Telephone (020) 7935 4422
Facsimile (020) 7487 2670

<<www.marksandspencer.com>>

Please note that electronic mail may be monitored.

This e-mail is confidential. If you received it by mistake, please let us know and then delete it from your system; you should not copy, disclose, or distribute its contents to anyone nor act in reliance on this e-mail, as this is prohibited and may be unlawful.