1.

Solve : replace a line with another line?

Answer»

i have a script that gets a line number and i need t replace the line at that line number how would i do that?Let's see your script.
You have a script? Where? (I can't see it, although I'm staring real hard at the monitor!) The script "gets a line number"? Where from? And where is the line you WANT to replace? In a TEXT file? Of what format? Not enough information.
sorry i should have been more informative so ANYWAYS the user passes parameters like so Code: [Select]replace 3 b and if the text file data.dat contains
a
b
c
d
e
it would become
a
b
b
d
eSo when you wrote "I have a script" you really meant "I want a script"?
yesYou want a script completely written from scratch, with no input from yourself? Is this a homework project, or SOMETHING for work?
Ah, BillFish to the rescue...
Quote

You want a script completely written from scratch, with no input from yourself? Is this a homework project, or something for work?
this is not a homework project nor from work (im 14)i just had no idea how to do this but bills solution actually worked


Discussion

No Comment Found