gpt4 book ai didi

linux - 在linux中用制表符替换空格

转载 作者:IT老高 更新时间:2023-10-28 12:24:28 25 4
gpt4 key购买 nike

如何在给定的文本文件中用 linux 中的制表符替换空格?

最佳答案

使用 unexpand(1) 程序


UNEXPAND(1)                      User Commands                     UNEXPAND(1)

NAME
unexpand - convert spaces to tabs

SYNOPSIS
unexpand [OPTION]... [FILE]...

DESCRIPTION
Convert blanks in each FILE to tabs, writing to standard output. With
no FILE, or when FILE is -, read standard input.

Mandatory arguments to long options are mandatory for short options
too.

-a, --all
convert all blanks, instead of just initial blanks

--first-only
convert only leading sequences of blanks (overrides -a)

-t, --tabs=N
have tabs N characters apart instead of 8 (enables -a)

-t, --tabs=LIST
use comma separated LIST of tab positions (enables -a)

--help display this help and exit

--version
output version information and exit
. . .
STANDARDS
The expand and unexpand utilities conform to IEEE Std 1003.1-2001
(``POSIX.1'').

关于linux - 在linux中用制表符替换空格,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1424126/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com