Actually my question is quite simple:
I have a string like: 101222_1_1_ab;
I hope to change it into: 101222_1_ab_1
What bash commands should I use? and what to do in python?
THanks
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.
The easiest mechanism I can think of is to use
awk(1):The
-F_asksawk(1)to split fields apart on underscores.Update Glenn Jackman recommends the following, far more legible, version: