Welcome to the VanDyke Software Forums

Join the discussion today!


Go Back   VanDyke Software Forums > General

Reply
 
Thread Tools Display Modes
  #1  
Old 10-20-2017, 12:22 AM
doyanger doyanger is offline
Registered User
 
Join Date: Oct 2017
Posts: 5
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!
Reply With Quote
  #2  
Old 10-20-2017, 08:15 AM
bgagnon bgagnon is offline
VanDyke Technical Support
 
Join Date: Oct 2008
Posts: 3,979
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.
__________________
Thanks,
--Brenda

VanDyke Software
Technical Support
support@vandyke.com
(505) 332-5730
Reply With Quote
  #3  
Old 10-24-2017, 03:07 AM
doyanger doyanger is offline
Registered User
 
Join Date: Oct 2017
Posts: 5
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, is there any option to enable it?
Reply With Quote
  #4  
Old 10-24-2017, 08:51 AM
bgagnon bgagnon is offline
VanDyke Technical Support
 
Join Date: Oct 2008
Posts: 3,979
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?
__________________
Thanks,
--Brenda

VanDyke Software
Technical Support
support@vandyke.com
(505) 332-5730
Reply With Quote
  #5  
Old 10-24-2017, 08:13 PM
doyanger doyanger is offline
Registered User
 
Join Date: Oct 2017
Posts: 5
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?
Reply With Quote
  #6  
Old 10-25-2017, 08:13 AM
bgagnon bgagnon is offline
VanDyke Technical Support
 
Join Date: Oct 2008
Posts: 3,979
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?
__________________
Thanks,
--Brenda

VanDyke Software
Technical Support
support@vandyke.com
(505) 332-5730
Reply With Quote
  #7  
Old 10-25-2017, 09:34 AM
bgagnon bgagnon is offline
VanDyke Technical Support
 
Join Date: Oct 2008
Posts: 3,979
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
__________________
Thanks,
--Brenda

VanDyke Software
Technical Support
support@vandyke.com
(505) 332-5730
Reply With Quote
  #8  
Old 10-27-2017, 12:06 AM
doyanger doyanger is offline
Registered User
 
Join Date: Oct 2017
Posts: 5
Quote:
Originally Posted by bgagnon View Post
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))
Attached Images
File Type: png screen_20171027-133819.png (16.3 KB, 220 views)
File Type: png screen_20171027-133731.png (26.2 KB, 235 views)
Reply With Quote
  #9  
Old 10-27-2017, 07:23 AM
bgagnon bgagnon is offline
VanDyke Technical Support
 
Join Date: Oct 2008
Posts: 3,979
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
__________________
Thanks,
--Brenda

VanDyke Software
Technical Support
support@vandyke.com
(505) 332-5730
Reply With Quote
  #10  
Old 11-09-2017, 07:27 PM
doyanger doyanger is offline
Registered User
 
Join Date: Oct 2017
Posts: 5
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!!!
Reply With Quote
  #11  
Old 11-10-2017, 07:50 AM
bgagnon bgagnon is offline
VanDyke Technical Support
 
Join Date: Oct 2008
Posts: 3,979
Hi doyanger,

You are quite welcome. Have a great weekend!
__________________
Thanks,
--Brenda

VanDyke Software
Technical Support
support@vandyke.com
(505) 332-5730
Reply With Quote
Reply

Tags
display , tab


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -6. The time now is 10:15 AM.