Friday, May 3, 2024
4
rated 0 times [  4] [ 0]  / answers: 1 / hits: 5522  / 2 Years ago, sat, march 26, 2022, 5:33:56

I am working with the egrep command and I need to pair with the cut (and ONLY cut) command to change a ":" into a tab. For example change:



Blahblahblah:2000


to:



Blahblahblah    2000


I currently have this, but it turns the ":" into "/t" and not tab:



egrep -e "^[0-9]" *.txt | cut -d ":" --output-delimiter="/t" -f 1- > test.txt

More From » command-line

 Answers
2

Use this:



egrep -e "^[0-9]" *.txt | cut -d ":" --output-delimiter=$'	' -f 1- > test.txt


should work in Bash.


[#27047] Saturday, March 26, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
curatekill

Total Points: 376
Total Questions: 117
Total Answers: 102

Location: Wales
Member since Mon, May 17, 2021
3 Years ago
curatekill questions
Fri, Sep 30, 22, 17:23, 2 Years ago
Sun, May 21, 23, 23:32, 1 Year ago
Sat, May 15, 21, 11:19, 3 Years ago
;