When entering show_transfers
into monero-wallet-cli, one is provided a list of in- and out- transactions related to that wallet. Is there a way to use that command to export the data into a txt, csv, or other type of file?
2 Answers
https://askubuntu.com/questions/420981/how-do-i-save-terminal-output-to-a-file
To write the output of a command to a file, there are basically 8 commonly used ways.
Overview:
|| visible in terminal || visible in file || existing
Syntax || StdOut | StdErr || StdOut | StdErr || file
=========++==========+==========++==========+==========++===========
> || no | yes || yes | no || overwrite
>> || no | yes || yes | no || append
|| | || | ||
2> || yes | no || no | yes || overwrite
2>> || yes | no || no | yes || append
|| | || | ||
&> || no | no || yes | yes || overwrite
&>> || no | no || yes | yes || append
|| | || | ||
| tee || yes | yes || yes | no || overwrite
| tee -a || yes | yes || yes | no || append
List:
command > output.txt
The standard output stream will be redirected to the file only, it will not be visible in the terminal. If the file already exists, it gets overwritten.
command >> output.txt
The standard output stream will be redirected to the file only, it will not be visible in the terminal. If the file already exists, the new data will get appended to the end of the file.
command 2> output.txt
The standard error stream will be redirected to the file only, it will not be visible in the terminal. If the file already exists, it gets overwritten.
command 2>> output.txt
The standard error stream will be redirected to the file only, it will not be visible in the terminal. If the file already exists, the new data will get appended to the end of the file.
command &> output.txt
Both the standard output and standard error stream will be redirected to the file only, nothing will be visible in the terminal. If the file already exists, it gets overwritten.
command &>> output.txt
Both the standard output and standard error stream will be redirected to the file only, nothing will be visible in the terminal. If the file already exists, the new data will get appended to the end of the file..
command | tee output.txt
The standard output stream will be copied to the file, it will still be visible in the terminal. If the file already exists, it gets overwritten.
command | tee -a output.txt
The standard output stream will be copied to the file only, it will still be visible in the terminal. If the file already exists, the new data will get appended to the end of the file.
-
For future viewers, use the
--command
option to accomplish this from the shell, i.e.,$ monero-wallet-cli --wallet-file <file> --command show_transfers > transfers.txt
Nov 8, 2019 at 17:15 -
Also note that the password prompt will not be shown (unless this is eventually changed/fixed), so you must then enter your password for it to proceed. Nov 8, 2019 at 17:36
You can always copy/paste from the terminal, or if you could do it by RPC and pipe the output to a text file.