Let me know if this helped you or in case you have any questions / comments. It’s columns will be rows and rows will have become columns. Your original table will now appeared reserved. Go back to MS-Word and paste the table by pressing Ctrl + V Select the reversed table and again do Ctrl + C to copy it. It will open a dialog box wherein you will have the option to Transpose the table.
And there you go! The table in Excel will invert like a magic.įrom the dropdown menu, you can also Paste Special option. From this menu select the option of Transpose. A menu with several options will drop down. Excel menu showing Transpose option.Ĭlick on the down arrow given on the Paste button in the Home tab of Excel. Select the just pasted table in Excel and paste it in another cell. The spreadsheet will automatically and neatly arrange pasted data in various cells to recreate the exact table.
Press Ctrl + V to paste the Word table content into Excel. Open a new Worksheet in MS-Excel and place the cursor in cell A1 (the first cell) Press Ctrl + C to copy the content of table.
Select the entire table by clicking on the plus ( + ) like sign on the top-left corner of table. Now, in the document, locate the table you want to act upon. Open your MS-Word document that contains the table you want to reverse. I will talk only about the clean method and it goes like this: One is a clean (and therefore preferred!) method and then there is another one that I would keep in the category of hacks. There are two methods to achieve this goal. Let’s see how we can go about transposing a table. This particular transition is called transposition. change rows into columns and columns into rows). This was related to inverting a table in Microsoft Word (i.e.
The second pass is O(n + combined length of all words / 2) = O(n + n/2) = O(n), which makes this an O(n) algorithm.Sometime ago I had written a piece on how to reverse a list (numbered or unnumbered) in MS-Word.
The first pass over the string is obviously O(n/2) = O(n). Google used it as one of their qualifier questions in Google CodeJam in the past, too. Trivia: This is a very old interview question. Ignore the extra linear space used in that conversion, as long as you're only using constant space after conversion to character array. Convert it back to the string before returning. Usage of built-in string functions is NOT allowed.įor languages that have immutable strings, convert the input string into a character array and work in-place on that array. Punctuation marks are considered a part of the word.
Words in s are separated by one or more spaces. Just enter your text and get the result immediately The Reverse Text Generator will help you flip letters in any direction, reverse a word and a sentence. Given a string s containing a set of words, transform it such that the words appear in the reverse order.