I want to change any None to 'None' (note single quotes) in a JSON file that contains both already.
type: None or
type: 'None'
I tried "s/[']?None[']?/'None'/g" but it doesn’t seem to work.
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.
Since you are changing all
Noneto'None', wouldn’t it be easier to just usestr.replacewith that json string? I’d run it in two procedures, first change'None'toNone, then change allNoneto'None'.