Click here to Skip to main content
15,896,398 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Tool to replace tabs with --- variable number of spaces --- and preserving width? Pin
_Flaviu3-Oct-19 1:32
_Flaviu3-Oct-19 1:32 
GeneralRe: Tool to replace tabs with --- variable number of spaces --- and preserving width? Pin
arnold_w3-Oct-19 1:52
arnold_w3-Oct-19 1:52 
AnswerRe: Tool to replace tabs with VARIABLE NUMBER OF SPACES and preserve column alignment? Pin
Richard MacCutchan3-Oct-19 2:16
mveRichard MacCutchan3-Oct-19 2:16 
GeneralRe: Tool to replace tabs with VARIABLE NUMBER OF SPACES and preserve column alignment? Pin
phil.o3-Oct-19 2:29
professionalphil.o3-Oct-19 2:29 
GeneralRe: Tool to replace tabs with VARIABLE NUMBER OF SPACES and preserve column alignment? Pin
Richard MacCutchan3-Oct-19 2:37
mveRichard MacCutchan3-Oct-19 2:37 
GeneralRe: Tool to replace tabs with VARIABLE NUMBER OF SPACES and preserve column alignment? Pin
phil.o3-Oct-19 2:46
professionalphil.o3-Oct-19 2:46 
GeneralRe: Tool to replace tabs with VARIABLE NUMBER OF SPACES and preserve column alignment? Pin
Richard MacCutchan3-Oct-19 2:53
mveRichard MacCutchan3-Oct-19 2:53 
AnswerRe: Tool to replace tabs with VARIABLE NUMBER OF SPACES and preserve column alignment? Pin
phil.o3-Oct-19 2:27
professionalphil.o3-Oct-19 2:27 
Since the process involves the use of the clipboard, there are a couple of solutions which come to my mind:

  • You could create a VBA macro in Excel which would format the contents:

    • You would need some PADLEFT or PADRIGHT kind of function:
      vba
      Function PadLeft(text As Variant, totalLength As Integer, padCharacter As String) As String
          PadLeft = String(totalLength - Len(CStr(text)), padCharacter) & CStr(text)
      End Function
      
      Function PadRight(text As Variant, totalLength As Integer, padCharacter As String) As String
          PadRight = CStr(text) & String(totalLength - Len(CStr(text)), padCharacter)
      End Function
      (source: SO: Any method equivalent to PadLeft/PadRight?[^]
    • Then use one of these functions to pad the values to the width of the largest value and place the result in the clipboard.
    • Have a button in Excel which launches the macro (whose result will be formatted text exported to the clipboard).

  • Or find an utility which can automatically format the content of the clipboard according to a specified format string. Honestly, I have never searched for such a tool, I don't even know if that exists.

"Five fruits and vegetables a day? What a joke!
Personally, after the third watermelon, I'm full."

AnswerRe: Tool to replace tabs with VARIABLE NUMBER OF SPACES and preserve column alignment? Pin
leon de boer3-Oct-19 6:38
leon de boer3-Oct-19 6:38 
GeneralRe: Tool to replace tabs with VARIABLE NUMBER OF SPACES and preserve column alignment? Pin
arnold_w3-Oct-19 6:41
arnold_w3-Oct-19 6:41 
GeneralRe: Tool to replace tabs with VARIABLE NUMBER OF SPACES and preserve column alignment? Pin
leon de boer4-Oct-19 3:52
leon de boer4-Oct-19 3:52 
GeneralRe: Tool to replace tabs with VARIABLE NUMBER OF SPACES and preserve column alignment? Pin
arnold_w4-Oct-19 5:44
arnold_w4-Oct-19 5:44 
AnswerRe: Tool to replace tabs with VARIABLE NUMBER OF SPACES and preserve column alignment? Pin
arnold_w3-Oct-19 7:37
arnold_w3-Oct-19 7:37 
QuestionError C2059 C2143 Pin
_Flaviu2-Oct-19 7:59
_Flaviu2-Oct-19 7:59 
AnswerRe: Error C2059 C2143 Pin
David Crow2-Oct-19 9:22
David Crow2-Oct-19 9:22 
AnswerRe: Error C2059 C2143 Pin
CPallini2-Oct-19 9:52
mveCPallini2-Oct-19 9:52 
AnswerRe: Error C2059 C2143 Pin
Richard MacCutchan2-Oct-19 21:45
mveRichard MacCutchan2-Oct-19 21:45 
QuestionDisplays the image in Picture Control. Pin
Member 126614642-Oct-19 7:07
Member 126614642-Oct-19 7:07 
AnswerRe: Displays the image in Picture Control. Pin
Gerry Schmitz2-Oct-19 7:19
mveGerry Schmitz2-Oct-19 7:19 
GeneralRe: Displays the image in Picture Control. Pin
Member 126614642-Oct-19 7:41
Member 126614642-Oct-19 7:41 
QuestionRe: Displays the image in Picture Control. Pin
David Crow2-Oct-19 9:19
David Crow2-Oct-19 9:19 
AnswerRe: Displays the image in Picture Control. Pin
Victor Nijegorodov2-Oct-19 9:41
Victor Nijegorodov2-Oct-19 9:41 
GeneralRe: Displays the image in Picture Control. Pin
Member 126614642-Oct-19 10:37
Member 126614642-Oct-19 10:37 
GeneralRe: Displays the image in Picture Control. Pin
Victor Nijegorodov2-Oct-19 10:49
Victor Nijegorodov2-Oct-19 10:49 
GeneralRe: Displays the image in Picture Control. Pin
Member 126614642-Oct-19 11:04
Member 126614642-Oct-19 11:04 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.