Posted by Eliza on Thu 17 Jul 04:23
report abuse | download | new post
- #!/usr/bin/perl
- # makenotes.pl A text splitting tool for iPod Notes
- # (C) 2008 Matthijs Dalhuijsen (GPL)
- local $|=1;
- unless (@ARGV) {
- print "makenotes -- formats text documents for usage on iPod\n";
- print "Usage: $0 <filename(s)>\n";
- }
- foreach my $file (@ARGV) {
- if (-f $file) {
- print "$file exists\n";
- &chopfile($file);
- } else {
- print "$file not found\n";
- }
- }
- sub chopfile {
- print "processing $f\n";
- print "Please give a title for this book\n> ";
- my $title = <STDIN>;
- print "creating dir and splitting file into subfiles in 3 seconds\n";
- print "2\n";
- print "1\n";
- my $i = 0;
- for (my $x = 0; $x < @txt; $x++) {
- if ($x % 3800 == 0) {
- print IF "<TITLE>$i $title</TITLE>";
- print IF "<br><br>";
- $i++;
- }
- }
- }
Submit a correction or amendment below (click here to make a fresh posting)
After submitting an amendment, you'll be able to view the differences between the old and new posts easily.