Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1096123
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T00:14:05+00:00 2026-05-17T00:14:05+00:00

I have the following stringBuilder that I am using as part of Log4net log

  • 0

I have the following stringBuilder that I am using as part of Log4net log layout.

var sb = new StringBuilder(DateTime.Now.ToString(DateFormatString, CultureInfo.InvariantCulture));
            sb.Append("\t");
            sb.Append(log.EventAction);
            sb.Append("\t");
            sb.Append(log.Id);
            sb.Append("\t");
            sb.Append(log.MessageId);
            sb.Append("\t");
            sb.Append(log.CodeBlock);
            sb.Append("\t");
            sb.Append(log.Details);

I would expect the \t (tab) to give me an accurate tabbing as deliminator, so that when visually inspecting the text file, the columns would align. However this is not the case!

The columns are not aligning, and when I open up the text file in MS Word and “Display Special Characters”, I see that the same tab entries seem to exist, but visually in notepad, columns don’t align.

I’m really confused, maybe I need to review the definition of tab, can anyone provide insight or workaround to this issue?

Update:

I’ve noticed that if I have strings of identical length then the columns align, so for example:

string1(len5) TAB string2(len5) TAB string3(len5)
string1(len5) TAB string2(len5) TAB string3(len5)
string1(len5) TAB string2(len5) TAB string3(len5)

However if the strings differ in length, tab char is present, but strings don’t align:

string1(len5) TAB string2(len5) TAB string3(len5)
string1(len10) TAB     string2(len5) TAB string3(len5)
string1(len5) TAB string2(len5) TAB string3(len5)
string1(len10) TAB     string2(len5) TAB string3(len5)

Something like this…

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-17T00:14:05+00:00Added an answer on May 17, 2026 at 12:14 am

    A tab is just a logical separator. It has no magic ability to force the data to align, and it depends on how your viewer interprets tabs; it might mean “indent 4 characters”, it might mean “pad rounding to the nearest 8th character”. As such, it is normally very dependent on the existing data lengths. In Word it will usually be interpreted as “move to the next pre-defined tab”, but that depends on a: what tabs are defined in Word, and b: how wide the data is already (i.e. what is “next”).

    In Excel (or any spreadsheet) it will generally be interpreted as columns. For this reason, a spreadsheet is probably your best option for browsing tabular delimited data (if you care about columns).

    So; what viewer are you using?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following code: int result = -1; StringBuilder sb = new StringBuilder();
I have the following code: Dim lStatementText As String Dim lStatementString As New System.Text.StringBuilder
I have following simple code snippet: StringBuilder sb = new StringBuilder(); Locale l =
I have the following intentionally trivial function: void ReplaceSome(ref string text) { StringBuilder sb
Suppose I have the following expressions: Expression<Action<T, StringBuilder>> expr1 = (t, sb) => sb.Append(t.Name);
I have following LINQ statement: string[] str = { a, ab, abcd }; var
I am doing simple formatting for an email with StringBuilder and have code that
I am using Mono/C# on Linux and have the following C# code: [DllImport(libaiousb)] extern
I have a plain text file that I need to read in using C#,
EDIT: The solution is that I was using aastore, when I should have been

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.