From: Mark Probert Date: 2004-08-19T10:45:54+09:00 Subject: Ruby way to update file lines Hi. I have a need to update a config file. It uses '#' as a line comment marker. The config file looks like: # file comment # name1:foo1:bar:other name2:foo2:bar:other name3:foo3:bar:other name4:foo4:bar:other The name:foo combination is unique. What is the most efficient way to read in the file, update the line, and then write it back to the file. One update would be to place a '#' in col 1 #name3:foo3:bar:other Any thoughts appreciated. -mark.