Text de-justification to get correct substring

情到浓时终转凉″ 提交于 2019-12-13 04:04:05

问题


I have a text file which is made up with justify (all tabs aligned - different size).
Therefore I can't get the desired value at a certain column (substring).
Since this is a migration I can't change the format of the file.

How can I "de-justify" the text to spaces while preserving the spacing length, any scripts out there?

I need the upper value. replacing \t with a fixed value doesn't help.

*EDIT: files seems to be formatted with fmt

*EDIT2: Solution found it seems; when I use fmt on windows (coreutils) it stays the same.
However on my mac I get the desired result (maybe something in the win command not setup right).

fmt original_file >> new.txt

Grts


回答1:


There's probably lots of other ways to do this, but sublime text has built in tab to space conversion.

http://css-tricks.com/changing-spaces-tabs-sublime-text/



来源:https://stackoverflow.com/questions/23013090/text-de-justification-to-get-correct-substring

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!