Post a reply

Options
Add an Attachment

If you do not want to add an Attachment to your Post, please leave the Fields blank.

(maximum 10 MB; please compress large files; only common media, archive, text and programming file formats are allowed)

Options

Topic review

gautammca1

List fileName into a text file

Hello All,
I have a requirement to read the file names from SFTP folder and write into a local directly./ Please, can someone advise a simple way to do it from the command line?

I have tried in this way but the output is not as per expectation.

winscp.com userName:passworddxbegap131dv /script=dolist.txt > file.txt.

The output from script:-

Opening session using command-line parameter in scripting is deprecated. Use 'open' command instead.
Searching for host...
Connecting to host...
Authenticating...
Using username "HRAppoint_Staging".
Authenticating with pre-entered password.
Authenticated.
Starting the session...
Reading remote directory...
Session started.
Active session: [1] HRAppoint_Staging@dxbegap131dv

Ex[pected output -

DT_TLEO_HRDB_APPL_SYSTEM_20190211T211505.csv
DT_TLEO_HRDB_NHBD_SYSTEM_20190212T153123.csv
DT_TLEO_HRDB_NHEX_SYSTEM_20190207T185335.csv
DT_TLEO_HRDB_NHEX_SYSTEM_TEST.csv

Please advise!