Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm writing a program that emails some data to a few of my employee's

One of them tracks the data in excel so I added a purely data line in text to the bottom of the email so he can just copy and paste it into excel.

I used \t (tabs) to denote fields but when I paste, it all runs together. Is there a character to put in each field in a cell in excel?

share|improve this question
up vote 3 down vote accepted

You can use anything you want that doesn't appear in your data. A popular choice is either "," or "|". When you paste in your data there should be a little box that appears in the lower right of what you just pasted, and you can use that to modify how the data was imported, otherwise you can just use Data-> Text to columns. Then select deliminator, then type in the deliminator you want to use.

share|improve this answer
not exactly what i wanted but tab's dont seem to work in the email im sending (it replaced with 5 spaces) so i went with | and this combined with the text to column that you showed me finished the project. – Crash893 Aug 27 '10 at 13:48

As long as you use the same character in between each word (even a space) and then using the text to columns option in excel, then excel will automatically take those texts and convert them to a column, or separate cell:

"This is a test" will convert each word to a cell.

"This:is:a:test" will also, but you have to tell excel that the symbol is the colon. alt text

share|improve this answer
it also works with numbers as well. – KronoS Aug 26 '10 at 16:14

Are you creating your message in HTML? Tabs generally get replaced with spaces in HTML messages.

Try creating your e-mail in plain text format and the tabs should be retained and you'll get the expected behaviour when pasting into Excel.

share|improve this answer
thats what was happening, I replaced tab with | and it doesn't work as well as i wanted but its just 2 extra steps – Crash893 Aug 27 '10 at 13:46

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .