From: Shiny Hydra Date: 2010-03-18T03:27:54+09:00 Subject: Replace Text at Specific Positions Across Files Hello everyone, I'm new to Ruby and after trying to look through a ton of classes and methods, I decided it would be best to ask some more seasoned individuals for help. I'm currently working on a project that essentially deals with a relational DB in text format. There is a standard layout throughout a variety of text files and each of them have corresponding information. For example, if positions 10-17 is populated with genderM in a file with .aaa extension, male should be written in positions 30-34 in a file with .bbb extensions. There can be multiple lines, each relating to a different object. After looking through the file and directory classes I can't find a obvious way to code this. How would I write/overwrite a specific position number in a certain extension based on information from another file? I know to read the information I just use readlines and store the position using something similar to textfile1[10,7] and that I can use file.extname to get the extension, but beyond this I'm stuck. I apologize for the basic question, but I would greatly appreciate the help. Thanks! -- Posted via http://www.ruby-forum.com/.