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

how do I rename wireshark files in second folder to same name as files in old folder

0

Hi,

I currently have two folders, one with WireShark .pcapng files(folder A) and one with .csv files(folder B) that correspond with the .pcapng files. I would like to know if there is any way I can rename the files in folder B to have the same name as the files in folder A?

i've tried the replace command but couldn’t manipulate it to do what I want . Is there any way this is possible? Thanks, Jennifer

asked 28 Aug '12, 06:06

7878987's gravatar image

7878987
1113
accept rate: 0%

edited 28 Aug '12, 08:45


2 Answers:

0

Well, you can rename files on Windows with the ren (rename) command, and on Linux/Unix you can use the mv (move) command. As in "ren file1.pcapng fileA.pcapng" or "mv file1.pcapng fileA.pcapng". Note that it's dangerous to change the filename suffix (.pcapng) to something else, since it will not change the internal format of the files, and will tend to be confusing. Wireshark will still process the files, regardless of the suffix, if opened directly with Wireshark, but it's still confusing and not recommended.

answered 28 Aug '12, 08:31

griff's gravatar image

griff
36139
accept rate: 10%

Hi,

I have converted the files using tshark and extracted specific information into an excel file.What im having problems with keeping the same name for the excel files as the wireshark capture files.I might need to use a string so im currently experimenting with that.

Thanks,

(28 Aug '12, 08:42) 7878987

You do not want Wireshark files and Excel CSV files to have the exact same name, as the former files should be called {something}.pcapng and the latter files should be called {something}.csv. Pcap-ng files should not be given the suffix ".csv" and CSV files for Excel should not be given the suffix ".pcapng", for the reasons griff gave.

If you want to have the CSV file produced from foobar.pcapng to be named foobar.csv, and that's not the case with the files in folders A and B, you might have to rename them one at a time by hand.

(28 Aug '12, 21:31) Guy Harris ♦♦

0

Why do you want to rename the files? If the CSV files were generated with tshark (or wireshark), simply repeat the "export" operation and this time use the correct filename ;-))

Regards
Kurt

answered 28 Aug '12, 09:17

Kurt%20Knochner's gravatar image

Kurt Knochner ♦
24.8k1039237
accept rate: 15%