-----Original Message----- From: Brian Volk Sent: Monday, August 01, 2005 11:03 AM To: Beginners (E-mail) Subject: print to a specific location in a file
Hi All~ Is it possible to open a file and print to a specific location in the file? For example, I have a 1K file and 0 - 511 is where the small description is stored and starting in position 512 is the path to a pdf file.... If I do not have the path in position 512 the link will be broken on web site. Pls let me know if this is possible and where I can read about it. Thanks! Brian Volk ---------------------------------------------------------------------------- ---- I think I found what I was looking for... ( seek / read ) #!/usr/local/bin/perl use strict; use warnings; my $txt_file = "C:/brian/descriptions/product/small/70413.txt"; open (FILE, $txt_file) or die "can't open $txt_file: $!\n"; my $link; seek (FILE, 256, 0); read (FILE, $link, 150); print $link; --------------------------------------------------- now I just hope I can open the file replace the data in that byte position... :~) Thanks, Brian