RE: print to a specific location in a file
- From: BVolk@xxxxxxxxxxxxxx (Brian Volk)
- Date: Mon, 1 Aug 2005 14:28:38 -0500
-----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
- Follow-Ups:
- Re: print to a specific location in a file
- From: John W. Krahn
- Re: print to a specific location in a file
- Prev by Date: Re: Some help needed in trying for my first "working" program of my own.
- Next by Date: Re: print to a specific location in a file
- Previous by thread: print to a specific location in a file
- Next by thread: Re: print to a specific location in a file
- Index(es):
Relevant Pages
|