VanDyke Software Forums

VanDyke Software Forums (https://forums.vandyke.com/index.php)
-   General (https://forums.vandyke.com/forumdisplay.php?f=11)
-   -   how to print tab character directly on session (https://forums.vandyke.com/showthread.php?t=12866)

doyanger 10-20-2017 12:22 AM

how to print tab character directly on session
 
Is there anyone can tell me how to set option of SecureCRT correctly to display a right TAB(\t) character other than four blank characters?

I create a serial COM session on SecureCRT, my printer will print visible ASCII characters and un-visible TAB character, but SecureCRT will receive TAB character and display four blank characters other than TAB(\t) character, which is not my desired case.

I had try to set "Display tab as" in Emulation/Advanced category of the Session Options dialog with "\t" or "{TAB}", but it not works.

appreciate your help!

bgagnon 10-20-2017 08:15 AM

Hi doyanger,

And you were getting the same behavior before you enabled Display tab as initially?

Are you sure it's a tab character you are receiving from the remote?

The best way to find that out is to capture a raw log.

To create a raw log:
  • Before connecting with the session, select Raw Log Session from SecureCRT's File menu.
  • In the Select Log File dialog, choose a folder and filename in which you would like the log text to be stored and press the Save button. At this point, if you open the File menu, you will notice that the Raw Log Session menu item now has a check-mark next to it; this indicates that raw logging is activated.
  • Now connect to the remote machine and perform the actions that cause the behavior.
  • Disconnect the session and select Raw Log Session from the File menu to turn off the raw logging feature.

Since a raw log can contain sensitive information, feel free to send it as an attachment via email to support@vandyke.com. Please reference "Attn Brenda - Forum Thread #12866" in the subject line.

doyanger 10-24-2017 03:07 AM

Thanks for your quick reply!

And you were getting the same behavior before you enabled Display tab as initially?
=> yes, i can't copy printed message in SwcureCRT's display panel by Ctrl + C directly.


Are you sure it's a tab character you are receiving from the remote?
=> I confirm it's a TAB character.

I can get TAB character in Raw log file as you mentioned now, thank you for your help ~ but I think it is more convenient to get them by Ctrl + C directly in AP's panel:D, is there any option to enable it?

bgagnon 10-24-2017 08:51 AM

Hi doyanger,

You are not going to see a tab displayed in output in the terminal window as it is an "unprintable character".

What problem are you trying to solve?

doyanger 10-24-2017 08:13 PM

Hi Brenda
What problem are you trying to solve?
=> The serial remote will send formatted string, which is seperated by a TAB character, to SecureCRT, e.g. :

Raw data:
24c3 e972 (here the hex data is sperated by 1 TAB character)
29b1 f74d
28cd f40d
258a eca8
268e ef50
2822 f35f

Terminal data show as follow:
24c3 e972 (here the hex data is sperated by 4 blank characters)
29b1 f74d
28cd f40d
258a eca8
268e ef50
2822 f35f

These string display in terminal above, i wanted to copy them by Ctrl+C to my excel file simply, supposed they were located in 2 colums, but it fails, they are located in one colums.
It seems copying from Raw log file is the only right solution?

bgagnon 10-25-2017 08:13 AM

Hi doyanger,

I see. That can be as easy as mapping a one-line script to a button on the button bar and running it after you've copied the data to the clipboard:

crt.Clipboard.Text = Replace(crt.Clipboard.Text, " ", vbtab)

Does that work for you?

bgagnon 10-25-2017 09:34 AM

Hi doyanger,

My manager also suggested these alternatives:
  • https://support.office.microsoft.com...a-7a3e9c363ed7
    (use Excel's built-in capability to convert text to columns; this feature has been around in Excel for many years)

  • Log to a file named "MyLog.TSV" (Tab Separated Values), and then just right-click on that log file and choose Open With --> Excel.

  • Variation of the above (with logging enabled in the session) ... map a button on the button bar to run a script that launches Excel for you, pointing to the log file that SecureCRT already knows about.
Code:

        # $language = "VBScript"
        # $interface = "1.0"


        Set objExcel = CreateObject("Excel.Application")
        strFilePath = crt.Session.LogFileName
        objExcel.Workbooks.Open(strFilePath)
        objExcel.Visible = True


doyanger 10-27-2017 12:06 AM

2 Attachment(s)
Quote:

Originally Posted by bgagnon (Post 48321)
Hi doyanger,

I see. That can be as easy as mapping a one-line script to a button on the button bar and running it after you've copied the data to the clipboard:

crt.Clipboard.Text = Replace(crt.Clipboard.Text, " ", vbtab)

Does that work for you?

Hi Brenda
You means mapping a key on Keymap Editor toolbar button with the scripts you mentioned?
I try it, but SecureCRT report error when I press the key I've mapped after I copied the data to the clipboard:
Failed to open script file(crt.Clipboard.Text = Replace(crt.Clipboard.Text, " ", vbtab))

bgagnon 10-27-2017 07:23 AM

Hi doyanger,

No, I meant buttons on the button bar:

(Button Bar video)
https://www.youtube.com/watch?v=olyCcUWRimI

(Button Bar online tip)
https://www.vandyke.com/support/tips/buttonbar.html

But you should be able to map it to a hotkey also.

However, you cannot just put the line of script code, you have to save it as a script file. Put it in a file and save it as Filename.vbs. Then map your key to point to that script file. :)

To be honest, using Keymap Editor just means one more file to keep track of, we recommend mapping keys in the Terminal / Emulation / Mapped Keys category of Session Options.

If the keymap(s) need(s) applied to many or all sessions, see these tips on our website:

https://www.vandyke.com/support/tips/defaultset.html
https://www.vandyke.com/support/tips/multisessions.html

doyanger 11-09-2017 07:27 PM

Hi Brenda
sorry for my late reply!

I've save the script you provided to a vbs file, and modified to a 4-blank characters version:
crt.Clipboard.Text = Replace(crt.Clipboard.Text, " ", vbtab)

It do replace blank character with TAB.

Thank you for your warmly help!!!

bgagnon 11-10-2017 07:50 AM

Hi doyanger,

You are quite welcome. Have a great weekend! :)


All times are GMT -6. The time now is 09:14 AM.