Jump to content

Aligning text captured


 Share

Recommended Posts

What i try to do is following

1.capture text from the active window.

2.This text is in columns. So I created variables for each column $col1 , $col2

3.Rearrange the text blocks in a new order . I created a variable $newview = $col3 & @tab & $col2...

4.copy this info to the clipboard so it can be pasted in an email.

This works, however when you paste it, the view looks garbled

exampledata1 result1

exampledatammm result2

exampledata123 result2

....

I've used $col1 = StringFormat("%-31.31s", $col1) to control the string width for each column

So I assumed the output would form neat columns. The problem seems to be caused by the fonttype.

Although each string from col1 is exactly 31 characters long, the field lenght is not equal if more 'wide' characters are in the string

This causes the tab instruction to jump to the next tab.

Is there a way to control this ?

Edited by eddyd
Link to comment
Share on other sites

The easiest way to avoid this effect is to use a fixed-space font like "Courier New", where an "i" is as wide as a "w".

You could also try to put your data into a html table instead of plain text, some mail programs can interpret html in the mail code and display a table.

Best regards,

Marc

Any of my own codes posted on the forum are free for use by others without any restriction of any kind. (WTFPL)

Link to comment
Share on other sites

The easiest way to avoid this effect is to use a fixed-space font like "Courier New", where an "i" is as wide as a "w".

You could also try to put your data into a html table instead of plain text, some mail programs can interpret html in the mail code and display a table.

Best regards,

Marc

I also thought of that, but how do I do that ? How do I define that $newview should use courier font ?

rgds/eddy

Link to comment
Share on other sites

  • Moderators

eddyd,

The clipboard data takes on the default font of your e-mail program when it is "pasted in an email". So it is in your e-mail program that you need to set the mono-spaced font.

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...