This console application will write .txt files to disc.
User wants to import these .txt files into Excel such that they are formatted correctly, so I plan to use tabs.
I keep getting this nonsense "Some string /t some other string /t/t some other string". There is no Environment.Tab like there is Environment.NewLine.
How do I get the tabs and not /t into my strings?
I'm sure there's a way and it'll probably be so obvious that I'll have to call myself faint all day on response.
(I'm open to other solutions as well. I might have to use | or some other delimiter/character.)
If you use the "\t" escape character once, it adds one tab space in string. This tab character can be used in a string or just directly passed and concatenated with a string and written to console.
Generally, a tab is the same width as 4 to 5 spaces provided the font being used equally sizes each character. For example, the Courier font's tab equals 5 spaces, whereas the Arial font is 11 spaces to each tab when the font size for both is set to 12.
Sets the distance in spaces between tab stops. The default is four spaces.
Tabs in strings are typically written \t
, not /t
. Are you escaping your string correctly?
If the purpose is to create text files which will eventually be imported int excel why don't you use comma separated values. More info http://en.wikipedia.org/wiki/Comma-separated_values
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With