sivasakthi wrote:
I have the text file as following,
this first line
this is the second line
this the third line
this is the fourth line
this is the sixth line
this is the seventh line
while opening and reading that text file, is it possible to get the byte
position of "this is the sixth line" ??
Jeff answered your question.
Assuming that your goal is to insert the missing fifth line, you may
want to use this approach:
use Tie::File;
tie my @file, 'Tie::File', 'myfile' or die $!;
splice(@file, 4, 0, 'this is the fifth line');
untie @file;
perldoc Tie::File
perldoc -f splice
--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/