title: File Formatting with sed
body: <p>I've been trying to manipulate a single line in a file without much success.</p>
  <p>test.txt</p>
  <blockquote>
  <pre><code>10.20.30.40 &quot;User 1&quot;
  73.15.16.24 NewUser
  124.18.21.17 &quot;User 2&quot;
  27.76.58.248 &quot;User 3&quot;
  39.16.87.227 &quot;User 4&quot;
  211.129.20.52 &quot;User 5&quot;
  175.15.118.110 &quot;User 6&quot;
  </code></pre>
  </blockquote>
  <p>If you notice the second line doesn't have quotes around the last word. I have been trying to figure out a way to put quotes around that and save it, either in another file, or preferably in the original.</p>
  <p>When I used this command:</p>
  <pre><code>cat test.txt | grep -v '&quot;.*&quot;' | sed -i 's/\([A-Z]\)/&quot;\1/g'
  </code></pre>
  <p>It finds the correct line and places a quote at the beginning of the word, but then puts another before the U, which isn't what I need. I could always use sed to place a quote at the last position of course, but it would be nice to encompass the entire word.</p>
  <p>If I then use the sed command with the -i and point it to the original file, it then throws quotes around every word when saved, which is also what I'm not wanting.</p>
  <p>Any help is appreciated, I've been trying to solve this for a couple of days now.</p>