Read text from putty

I want to copy the output from the putty session command into a text file. This output is dynamic, it changes from time to time. Please help. Thanks in advance.

Try screen scrapping, it may work.

@skini76 already tried, not working

Hi @lalithvoop

Try to use Get visible text and indicate it with putty window and save output in one Variable

JothyPrasanth M

Hi @lalithvoop

You can set your Putty session to export the output automacally in a Log file instead of copy the text from screen.

Look at the article below.

I hope it helps you.


thanks a lot guys for really quick replies @thomazuehara I will surely try this method and @jothyprasanth.m i approach was something same but lengthy. As an alternative i chose this method. (i was accessing a linux system through putty) :

  1. i wrote a command awk ‘{for (I=1;I<=NF;I++) if (I == "apple") {print (I+2)};}’ /home/testing.txt > sample.txt. This command will store the output in sample.txt file.
  2. vi sample.txt. This command displays the output in the first line. I chose get visible text (area) and stored it in variable.
  3. Later i deleted the file.
    I know this is really a very long method but as the time did not permit, i had to do this. I just posted it here coz, it might be useful to anyone in the future. Thanks
1 Like


I have the same scenario, please help me in how to export the output automatically in to a text file from putty session.


Please look at this screenshot.