I have a string like this
BRADI5G20430|BRADI5G20430.1||1
How can I replace the bar (single and multiple) with tab (“\t”)?
I tried this but dont’ work
sed 's/\|+/\t/g'
I also want to include this line in bash script.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
you need to escape the
+or you can use
-roption of sed, but this time, the+will be “one or more” and you need to escape the “|” since in regex, it means alternation.or use awk, set field separator to “|” and then set output field separator
OFSto tab\teg
this replaces each tab with “|”. If you want to replace all “|” with one tab