We have moved to www.dataGenX.net, Keep Learning with us.

Tuesday, October 16, 2012

How to convert a (multiple) space separated text into Tab delimited (with WORD)

1) paste the columnar text in an empty Word Document
2) Start the search/replace function
2) In the search field input 2 (two) spaces
3) in the replace field input ^t (the character t preceded by ^ means a TAB)

4) run the replace until no more occurrences of the two spaces is found
5) now input in the search field ^t^t (it means two conscutive TABs)
6) leave the replace field as is
7) run the replace until no more occurrences of double TABs are found
8) if the number of spaces between the columns was ODD, there can still be occurrences of either TAB followed by a single space or of a single space followed by a TAB, to "clean them re-run the replace function once with [space]^t and once with ^t[space] in the search field
9) copy the now tab-delimited text
10) paste it to the "final" word document

 At this point you can (as you wish) set the TABs or select the data and convert it to a table using the TXT->Table function, specifying that the separator is a TAB

 If you enable seeing "hidden characters" in the WORD document (where a space is shown as a dot and a tab is shown as a right handed arrow) will help you visually analize the proceedings.

 Just for the record, the apparent "misalignment" you experienced is due to the fact that NOTEPAD uses a FIXED font, whilst WORD usally defaults to Times New Roman which is a PROPORTIONAL font, i.e. a font where a letter like W takes as much as THREE times the space for a letter I.

njoy the simplicity.......
Atul Singh

No comments :

Post a Comment