Find the answer to your Linux question:
Results 1 to 4 of 4
hi friends., my ascii file is as shown 1 41.18324 117.2673 *** 2 41.18324 117.2799 12.78 3 41.18324 117.2925 *** ---------------- ---------------- 299859 37.65457 122.0885 16.8 299860 37.65457 122.1011 16.668 ...
  1. #1
    Just Joined!
    Join Date
    Feb 2008
    Posts
    10

    replacing *** with 0 in ascii data file

    hi friends.,
    my ascii file is as shown
    1 41.18324 117.2673 ***
    2 41.18324 117.2799 12.78
    3 41.18324 117.2925 ***
    ----------------
    ----------------
    299859 37.65457 122.0885 16.8
    299860 37.65457 122.1011 16.668
    --------------------
    ------------------
    657522 33.21582 127.602 23.532
    657523 33.21582 127.6146 23.532

    like wise i have 100's of files..
    In all the files i have to replace the *** (represents no data in my file) with 0( zero).
    i could not match those *** with the sed. ( am unfamiliar with regexp )

    any suggestions plz

    thanks in advance..
    Yagnesh

  2. #2
    Linux Engineer wje_lf's Avatar
    Join Date
    Sep 2007
    Location
    Mariposa
    Posts
    1,192
    am unfamiliar with regexp
    That is the underlying problem, of course. And it's easily solved. google this:
    Code:
    regexp tutorial
    --
    Bill

    Old age and treachery will overcome youth and skill.

  3. #3
    Linux User
    Join Date
    Jun 2007
    Posts
    318
    Plus you didn't list the sed command you tried to use.

  4. #4
    Just Joined!
    Join Date
    Feb 2008
    Posts
    10
    hi thanks for the replies...
    i did it with

    Code:
    sed  's/\*\*\*/0/g' filename
    BTW thanks for not mentioning the code earlier..

Posting Permissions

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