Script to convert multiple spaces to a tab

February 7, 2011 at 17:30:27
Specs: Windows XP
I am trying to create a batch file to convert multiple spaces in a text file to a single tab, to make it tab delimited.

Here is a sample of the input:

 1	200	226	    213.2    5.46    39.04	  - Low Signal

Desired output:

 1	200	226	213.2	5.46	39.04	- Low Signal

I have tried several scripts from the forums, but each one has the same problem.
The input has tabs after the first 3 columns, then 4 spaces following the tab after the 3rd column, and finally 4 spaces between the next 4 columns.
The scripts I have tried all failed converting the delimiter after the 3rd column.
It seems that a tab followed by 4 spaces messes up any 'space to tab' converters.

Any suggestions would be greatly appreciated.
Thank you in advance.


See More: Script to convert multiple spaces to a tab

Report •

#1
February 8, 2011 at 02:36:54
The line you posted has no yabs. So maybe you can put your file on the web and post the link.


=====================================
Life is too important to be taken seriously.

M2


Report •

#2
February 8, 2011 at 05:52:20
How many spaces triggers a tab?

How To Ask Questions The Smart Way


Report •
Related Solutions


Ask Question