0

I have a file located in unix command line using 'SecureCRT'. I want to get this file's data in excel so I need a .txt file. I have 'WinSCP' installed aswell.

After I do "more [file name]" it displays all the data I want.

How do I get copy this data in a text file and transferred to my pc.

Thanks.

Jeff Schaller
  • 67,283
  • 35
  • 116
  • 255

1 Answers1

0

on the ssh session, run the command :

cat file_name > file_name.txt

start WinSCP

in the host box type the name of the server you are connecting to

in the username box type the name you are using to login to ssh session click connect

it will ask you for your password. Type it in the box

at this point, you should see your home directory contents on the right pane of the WinSCP screen.

Find the file_name.txt you want on excel, drag and drop it on your desktop

It is actually very trivial. Or am I missing something ?

MelBurslan
  • 6,966
  • Sorry, the winscp part is fine, i am logged in. Its the creating of the file in the unix. So Cat 'file name i want to turn to txt' > 'file name i want to create.txt' Correct? When I cat then paste the file name beside it, it starts to load in SecureCRT, so I dont even get a chance to right the txt file I want to create. – Ladiesman191 Jan 22 '16 at 15:14
  • on your screen type the command I gave above cat file_name > file_name.txt by hand and hit enter. Do not try copy and pasting from here or any other source as secureCRT sometimes put funky characters and cause an unexpected results. If you did this, you should be able to see a file_name.txt file on the winSCP right pane. If not, try refreshing the screen on WinSCP (two semicircle shaped green arrows, if you are using the same version I do) – MelBurslan Jan 22 '16 at 15:28
  • Do I have to be in the same directory in securecrt as i am in Wcp when creating file? It seems to work , i just dont have permission to create new file it seems. – Ladiesman191 Jan 22 '16 at 15:56
  • @Ladiesman191 why do you think you need to create a new file? If you can view the file using more, then it is most likely already a text file (or possibly a compressed text file). If it simply needs a .txt extension in order for your PC OS to recognize it as such, it may be sufficient simply to rename it after copying it over. – steeldriver Jan 22 '16 at 16:31
  • You don't have to be in the same directory but it helps finding it fast on WinSCP. If you can not create files where you are, then try creating the file under /tmp. That directory should be open to a write for everyone. Try this command: cat file_name > /tmp/filename.txt. Then with WinSCP, traverse your way to /tmp to find your newly created file. – MelBurslan Jan 22 '16 at 16:32
  • renaming after copy should also work, if it is an option for you – MelBurslan Jan 22 '16 at 16:33
  • @steeldriver , I view it using more, but the file is large and hard to copy directly over to excel due to format. How can I copy the file over directly? your right i dont need a new file. – Ladiesman191 Jan 22 '16 at 16:42
  • @MelBurslan , is there a way instead of using more to view it, to just copy the file over to winscp? I dont need to make a new txt file, sorry for the newb questions. – Ladiesman191 Jan 22 '16 at 16:44
  • @Ladiesman191 what is stopping you from just selecting the file in Winscp and drag it to the local pane? – steeldriver Jan 22 '16 at 16:45
  • Agree with @steeldriver's last comment. You can drag and d to your local machine using WinSCP and rename it over there. – MelBurslan Jan 22 '16 at 16:46
  • @steeldriver , didnt think I could navigate to it from here. Its quite a large directory when i search for it so I have to end up aborting in winscp – Ladiesman191 Jan 22 '16 at 16:53