Find the answer to your Linux question:
Results 1 to 2 of 2

Thread: help with sed

Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1

    help with sed

    Ive been trying to use sed to change an output file from a model im working with. The model outputs some data to a text file and for some reason, outputs zero as .0000 , which gives me a probelem with my graphics package (it needs to be 0.0000). Ive tried using sed with the command :

    sed 's/ .0/0.0/g'

    but it doesnt properly work. It changes 0.* to 0.0.* as well! Is there something im missing? Is there a proper way of specifying blank spaces?

    Thanks in advance

  2. #2
    Linux Enthusiast scientica's Avatar
    Join Date
    Sep 2003
    South- or "Mid-" Sweden
    you need to escape the first '.', other wise it matches "any character"
    sed 's/ \.0/0.0/g'
    [edit]please, don't crosspost.[/edit]
    Regards Scienitca (registered user #335819 - )
    A master is nothing more than a student who knows something of which he can teach to other students.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts