How can I match whitespace in sed? In my data I want to match all of 3+ subsequent whitespace characters (tab space) and replace them by 2 spaces. How can this be done?
|
feedback
|
|
The character class For example:
will substitute every sequence of at least 3 whitespaces with two spaces. | ||||
|
feedback
|
|
Some older versions of sed may not recognize \s as a white space matching token. In that case you can match a sequence of one or more spaces and tabs with '[XZ][XZ]*' where X is a space and Z is a tab. | |||||
feedback
|