I have a script that I'm connecting to equipment, issuing commands and capturing response. I want to clean that data before dumping it to log. I don't know if I'm assigning array properly, but here is what I have: