How to replace/substitute a character in a 20GB file without opening it.

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • siri2403
    New Member
    • Jul 2007
    • 4

    How to replace/substitute a character in a 20GB file without opening it.

    Hi,

    I have a 20gb file which is having a bad character repeating throughout
    i would like to replace it with some other character, with out opening the file.

    normally i would have used a sed command
    sed 's/bad_char/new_char/' <old_file >new_file

    but i am not sure it would work on such a huge file......

    or is there any other way in which the big files have to behandled other than sed....

    Please help me regarding this....

    Thanks in advance
    Siri.
  • ashitpro
    Recognized Expert Contributor
    • Aug 2007
    • 542

    #2
    Originally posted by siri2403
    Hi,

    I have a 20gb file which is having a bad character repeating throughout
    i would like to replace it with some other character, with out opening the file.

    normally i would have used a sed command
    sed 's/bad_char/new_char/' <old_file >new_file

    but i am not sure it would work on such a huge file......

    or is there any other way in which the big files have to behandled other than sed....

    Please help me regarding this....

    Thanks in advance
    Siri.
    well,
    I guess 'sed' will be the best option for this job.
    try it out and see how much time it takes

    Comment

    Working...