overwrite specific lines in a file

Hi all,

I am trying to overwrite some lines of a very big file.
I know the number of the line but I don't know how to point the cursor on its beginning. there is an option to notice the offset in lines?

thanks!

Are you in an editor?
for vi <esc>20204G takes you to line 20204

Or do you want to replace line #x with text using another tool?

no, I want to do it in a boot script.

I want to do it by commands lines.

For large files sed it's the best tool.

The ed(1) utility is typically used for such tasks.

Ok I have used it, but I think that my manner is not really elegant.

Do you know how to (by sed)...

overwrite a line which actually you only know how it begins but not how finishes?

I want to change a settings file... so I want to do something like that.

sed '49s/HorizSync[...]/HorizSync 30.0 - 83.0/g' xorg.conf

where [...] are characters which I don't know.

Thanks a lot!!

 sed 's/^HorizSync.*/HorizSync 30.0 - 83.0/g' file

Regards

Thanks, it works fine!!