Causes 7-Zip to write output data to stdout (standard output stream).
-so
7z x archive.gz -so > Doc.txt
decompresses archive.gz archive to output stream and then redirects that stream to Doc.txt file.
7z a dummy -tgzip -so Doc.txt > archive.gz
compresses the Doc.txt file to the 7-Zip standard output stream and writes that stream to archive.gz file.
a (Add), e (Extract), u (Update), x (Extract with full paths)