If I copy data in Excel and paste it in a text file, I get tabs between cells. That's not good, I want spaces – and I want the columns to be aligned. How can I achieve this without a lot of effort (obviously I don't want to start running regexps by hand etc.)
Using 'Save As' (as in this question) is not a solution for me, I need copying and pasting.
Best Answer
This is certainly not simple to explain... but after it is setup it will work with minimal effort. Also this is a slight variation on what @pnuts has outlined
I suggest using a template spreadsheet that you can copy-paste to. the template i have created has 3 tabs that look as follows.
Data
tab is where the data is pastedLength
is going to do some math to determine the longest columnSpace insert
is going to insert the appropriate number of spaces (edit) you can copy from here and get the correct resultthe length tab looks like
Row 1 has maximum characters of the column below is and contains the formula
+1 creates the delimiter.
Row 2 through to n (which i have extended to 100 for this example) contain a formula to evaluate the length of each string
the space insert tab looks like
Each cell contains a cell to evaluate the length of itself in comparison with the max value (+ delimiter) and insert an appropriate number of spaces.
Note the $ which locks Row 1 if you copy and paste the formula
(edit) you can copy from the space insert tab.