This is our old Q&A Site. Please post any new questions and answers at ask.wireshark.org.

I have described the problem I face when tshark uses , as a field delimiter in this question when writing output to a .csv file.

So I'd like a way to instruct Tshark to use another character, say \t, as field separator.

The normal Tshark command is something like:

tshark -r inputFile.pcap -T fields -e fieldA -e fieldB -e fieldC > outputFile.csv

What do I add to this command to instruct tshark to use \t as field separator, while writing the output to .csv file, rather than the default ,?

asked 11 Oct '16, 00:06

Jesss's gravatar image

Jesss
51141720
accept rate: 0%


As per the tshark manual or even built-in help; tshark -h:

  -E<fieldsoption>=<value> set options for output when -Tfields selected:
     bom=y|n               print a UTF-8 BOM
     header=y|n            switch headers on and off
     separator=/t|/s|<char> select tab, space, printable character as separator
     occurrence=f|l|a      print first, last or all occurrences of each field
     aggregator=,|/s|<char> select comma, space, printable character as
                       aggregator

so, use -E separator=/t, you might also want to consider adding quotes around fields, e.g. -E quote=d.

permanent link

answered 11 Oct '16, 00:43

grahamb's gravatar image

grahamb ♦
19.8k330206
accept rate: 22%

edited 11 Oct '16, 00:44

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×1,620
×832
×40
×8

question asked: 11 Oct '16, 00:06

question was seen: 2,689 times

last updated: 11 Oct '16, 00:44

p​o​w​e​r​e​d by O​S​Q​A