list of files in a txt file from sftp location

I want equivalent of ftp in sftp for listing of files into local machine from sftp location.

ftp>ls -l list.txt

the above creates a file list.txt in the local machine's current directory.

sftp>ls -l list.txt

it is giving
Couldn't stat remote file: No such file or directory

is there any way to the list of files in a txt file on my local machine.Please suggest.

Regards,
Megh

You can try this:

sftp -b - hostname >list.txt <<EOF
ls -l
EOF