0
votes

I need to clean my output log with specific fields in command line.

Current code returns all fields, log information in a txt file.

C:\Program Files\7-Zip>7z l "J:\FOLDER\FOLDER\*pattern*" > "C:\Users\me\Desktop\tst.txt"

Listing archive: PATH
Path = path_name
Type = zip
Physical Size = 0000011

Date Size Compressed Name ---- ----- ------- -----
01.07.2019 0 111 file_name 01.07.2019 0 111 file_name

I want my text output to return:

Date | Size | Compressed | Name 01.07.2019 0 111 name

1
"C:\Program Files\7-Zip\7z" l "J:\FOLDER\FOLDER\*pattern*" | findstr /V /I "^$ ^7-zip ^Scanning ^Listing ^Path ^Type ^Physical ^Comment ^-- file,.*bytes files$ folders$ ^Archives ^Volumes ^Total" or something alike? - JosefZ
@JosefZ - works perfectly! I tried to save it as output but no success while using > "C:\Users\me\Desktop\tst.txt" Still - goal achieved ;) - marcin2x4

1 Answers

0
votes

@JosefZ saved the day.

"C:\Program Files\7-Zip\7z" l "J:\FOLDER\FOLDER\*pattern*" | findstr /V /I "^$ ^7-zip ^Scanning ^Listing ^Path ^Type ^Physical ^Comment ^-- file,.*bytes files$ folders$ ^Archives ^Volumes ^Total"