Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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
add comment

3 Answers

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
add comment

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
add comment

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
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.