From rlharris at oplink.net Thu Jun 7 20:13:00 2018 From: rlharris at oplink.net (rlharris at oplink.net) Date: Thu, 7 Jun 2018 22:13:00 -0500 Subject: [pm-h] write to empty files Message-ID: My need is to write a string to each file in a directory (the same string, such as, "project xyz", needs to be written to each file). The files have been created with "touch", run from a bash script; so the file length is zero. My system is Debian. The operation "s//project xyz/" fails on a file of zero length. My Perl skills are rusty, and I have spent more than an hour searching the web without success, looking for a solution. Even more useful to me would be the ability to write to each file in a directory a string or a set of lines which include the current date and the filename or the full filepath: project xyz documentname.tex 2018.06.07 1950gmt project xyz /home/rlh/scratch/documentname.tex 2018.06.07 1950gmt From mrallen1 at yahoo.com Thu Jun 7 23:31:30 2018 From: mrallen1 at yahoo.com (Mark Allen) Date: Fri, 8 Jun 2018 01:31:30 -0500 Subject: [pm-h] write to empty files In-Reply-To: References: Message-ID: <20180608063137.5CB8F11ECC1@xx1.develooper.com> This kind of task is perfect for the module ?Path::Tiny? It has all of the functionality you?re talking about except the date stuff, and for that I?d probably choose Time::Piece because it?s shipped with core perl and can do date formatting easily. (See perldoc Time::Piece for all the details.) Path::Tiny *should* be in core Perl IMO but it?s a quick and dependency free download. use 5.014; use Path::Tiny; use Time::Piece; my $t = localtime; # Time::Piece object say ?$t?; # Fri Jun 8 01:25:46 2018 my $dir = path(?.?); for my $f ( $dir->children() ) { $f->spew_utf8(?project xyz\n$t\n?) } Sent from Mail for Windows 10 From: rlharris at oplink.net Sent: Thursday, June 7, 2018 11:58 PM To: Houston Perl Mongers Subject: [pm-h] write to empty files My need is to write a string to each file in a directory (the same string, such as, "project xyz", needs to be written to each file). The files have been created with "touch", run from a bash script; so the file length is zero. My system is Debian. The operation "s//project xyz/" fails on a file of zero length. My Perl skills are rusty, and I have spent more than an hour searching the web without success, looking for a solution. Even more useful to me would be the ability to write to each file in a directory a string or a set of lines which include the current date and the filename or the full filepath: project xyz documentname.tex 2018.06.07 1950gmt project xyz /home/rlh/scratch/documentname.tex 2018.06.07 1950gmt _______________________________________________ Houston mailing list Houston at pm.org http://mail.pm.org/mailman/listinfo/houston Website: http://houston.pm.org/ -------------- next part -------------- An HTML attachment was scrubbed... URL: From mikeflan at att.net Fri Jun 8 01:38:10 2018 From: mikeflan at att.net (Mike Flannigan) Date: Fri, 8 Jun 2018 03:38:10 -0500 Subject: [pm-h] write to empty files In-Reply-To: References: Message-ID: <7a0fc153-8d31-234e-a0be-e2c9653aa531@att.net> I'm not familiar with touch, but can't you just: 1) open the file for appending (>>) 2) print FILEHANDLE "project xyz"; Example: open OUT, ">>", $outfile or die "$0: open $outfile: $!"; # Or use the new way of opening a file print OUT "project xyz"; Mike On 6/7/2018 10:13 PM, rlharris at oplink.net wrote: > My need is to write a string to each file in a directory (the same string, > such as, "project xyz", needs to be written to each file). The files have > been created with "touch", run from a bash script; so the file length is > zero. My system is Debian. > > The operation "s//project xyz/" fails on a file of zero length. My Perl > skills are rusty, and I have spent more than an hour searching the web > without success, looking for a solution. > > Even more useful to me would be the ability to write to each file in a > directory a string or a set of lines which include the current date and > the filename or the full filepath: > > project xyz > documentname.tex > 2018.06.07 1950gmt > > project xyz > /home/rlh/scratch/documentname.tex > 2018.06.07 1950gmt > _______________________________________________ > Houston mailing list > Houston at pm.org > http://mail.pm.org/mailman/listinfo/houston > Website: http://houston.pm.org/ > From cblanc at dionysius.com Fri Jun 8 05:54:31 2018 From: cblanc at dionysius.com (Chris Blanc) Date: Fri, 8 Jun 2018 07:54:31 -0500 Subject: [pm-h] write to empty files In-Reply-To: References: Message-ID: I would write-append these lines to the file with the >> operator. I would use this for the pathname: http://perldoc.perl.org/File/Basename.html This might help with the timestamp: https://www.perl.com/pub/2003/03/13/datetime.html/ On Thu, Jun 7, 2018 at 10:13 PM, wrote: > > My need is to write a string to each file in a directory (the same string, > such as, "project xyz", needs to be written to each file). The files have > been created with "touch", run from a bash script; so the file length is > zero. My system is Debian. > > The operation "s//project xyz/" fails on a file of zero length. My Perl > skills are rusty, and I have spent more than an hour searching the web > without success, looking for a solution. > > Even more useful to me would be the ability to write to each file in a > directory a string or a set of lines which include the current date and > the filename or the full filepath: > > project xyz > documentname.tex > 2018.06.07 1950gmt > > project xyz > /home/rlh/scratch/documentname.tex > 2018.06.07 1950gmt > _______________________________________________ > Houston mailing list > Houston at pm.org > http://mail.pm.org/mailman/listinfo/houston > Website: http://houston.pm.org/ -- http://www.dionysius.com/ From mrdvt92 at yahoo.com Fri Jun 8 06:32:22 2018 From: mrdvt92 at yahoo.com (Michael R. Davis) Date: Fri, 8 Jun 2018 13:32:22 +0000 (UTC) Subject: [pm-h] write to empty files In-Reply-To: References: Message-ID: <1359292345.1861522.1528464742322@mail.yahoo.com> On Thursday, June 7, 2018, 11:42:26 PM EDT, rlharris at oplink.net wrote: >?My need is to write a string to each file in a directory (the same string,> such as, "project xyz", needs to be written to each file).? The files have >?been created with "touch", run from a bash script; so the file length is >?zero.? My system is Debian. No need for Perl when a simple Bash for loop will do. [temp]$ ls -ltotal 0-rw-rw-r--. 1 0 Jun? 8 13:24 x.txt-rw-rw-r--. 1 0 Jun? 8 13:24 y.txt-rw-rw-r--. 1 0 Jun? 8 13:24 z.txt [temp]$ for F in `ls`; do echo project.xyz > $F; done [temp]$ ls -ltotal 12-rw-rw-r--. 1 12 Jun? 8 13:24 x.txt-rw-rw-r--. 1 12 Jun? 8 13:24 y.txt-rw-rw-r--. 1 12 Jun? 8 13:24 z.txt [temp]$ more *::::::::::::::x.txt::::::::::::::project.xyz::::::::::::::y.txt::::::::::::::project.xyz::::::::::::::z.txt::::::::::::::project.xyz However, in Perl Path::Class::dir->spew is nice [temp]$ perl -MPath::Class=dir -e '$_->spew("project.xyz2") foreach dir(".")->children;' [temp]$ more *::::::::::::::x.txt::::::::::::::project.xyz2::::::::::::::y.txt::::::::::::::project.xyz2::::::::::::::z.txt::::::::::::::project.xyz2 -------------- next part -------------- An HTML attachment was scrubbed... URL: From rlharris at oplink.net Fri Jun 8 10:11:04 2018 From: rlharris at oplink.net (rlharris at oplink.net) Date: Fri, 8 Jun 2018 12:11:04 -0500 Subject: [pm-h] write to empty files In-Reply-To: References: Message-ID: <109d52e8f902404ba16662f1718ee4d4.squirrel@webmail.oplink.net> On Fri, June 8, 2018 7:54 am, Chris Blanc wrote: > I would write-append these lines to the file with the >> operator. > > > I would use this for the pathname: > http://perldoc.perl.org/File/Basename.html > > > This might help with the timestamp: > https://www.perl.com/pub/2003/03/13/datetime.html/ "touch" changes the timestamp of a file, but also creates non-existent files, and a file created by touch has zero length. I have been using touch in a bash script to create groups of files simply because it is an easy approach, and it has been years since I last did a cover-to-cover read of Learning Perl. But then the contents of each file must be created manually by copy-and-paste. I would prefer to use Perl to create the files with the desired headers. Once I know how to do that, I can make use of Perl to add additional file-specific material to each file, and save much time in manual editing. RLH From uri at stemsystems.com Fri Jun 8 10:20:16 2018 From: uri at stemsystems.com (Uri Guttman) Date: Fri, 8 Jun 2018 13:20:16 -0400 Subject: [pm-h] write to empty files In-Reply-To: <109d52e8f902404ba16662f1718ee4d4.squirrel@webmail.oplink.net> References: <109d52e8f902404ba16662f1718ee4d4.squirrel@webmail.oplink.net> Message-ID: <4ecc7ece-b018-7dab-1823-02d2d4b57c9c@stemsystems.com> On 06/08/2018 01:11 PM, rlharris at oplink.net wrote: > > I would prefer to use Perl to create the files with the desired headers. > Once I know how to do that, I can make use of Perl to add additional > file-specific material to each file, and save much time in manual editing. File::Slurp is your friend here. it can't be easier than this: use File::Slurp ; write_file( 'filename', "header text\n" ) ; that will work even on a 0 length file if it is writeable. touch should leave the files writeable. but with that call, you don't even need to have a file there in advance. and this will add more text to the end of the file: append_file( 'filename', "more text\nand even more\n" ) ; uri From rlharris at oplink.net Fri Jun 8 10:48:48 2018 From: rlharris at oplink.net (rlharris at oplink.net) Date: Fri, 8 Jun 2018 12:48:48 -0500 Subject: [pm-h] write to empty files In-Reply-To: <4ecc7ece-b018-7dab-1823-02d2d4b57c9c@stemsystems.com> References: <109d52e8f902404ba16662f1718ee4d4.squirrel@webmail.oplink.net> <4ecc7ece-b018-7dab-1823-02d2d4b57c9c@stemsystems.com> Message-ID: On Fri, June 8, 2018 12:20 pm, Uri Guttman wrote: > use File::Slurp ; > write_file( 'filename', "header text\n" ) ; > append_file( 'filename', "more text\nand even more\n" ) ; Thanks, Uri; this is what I hoped to find! But my knowledge of Perl is rusty; I do not recall what structure is needed to feed to this code a list of filenames, such as: foobar-01.tex foobar-02.tex foobar-03.tex ... From uri at stemsystems.com Fri Jun 8 11:01:50 2018 From: uri at stemsystems.com (Uri Guttman) Date: Fri, 8 Jun 2018 14:01:50 -0400 Subject: [pm-h] write to empty files In-Reply-To: References: <109d52e8f902404ba16662f1718ee4d4.squirrel@webmail.oplink.net> <4ecc7ece-b018-7dab-1823-02d2d4b57c9c@stemsystems.com> Message-ID: On 06/08/2018 01:48 PM, rlharris at oplink.net wrote: > On Fri, June 8, 2018 12:20 pm, Uri Guttman wrote: > >> use File::Slurp ; >> write_file( 'filename', "header text\n" ) ; >> append_file( 'filename', "more text\nand even more\n" ) ; > Thanks, Uri; this is what I hoped to find! > > But my knowledge of Perl is rusty; I do not recall what structure is > needed to feed to this code a list of filenames, such as: > > foobar-01.tex > foobar-02.tex > foobar-03.tex > ... i am not sure what you want but here is my guess my @files = qw( foobar-01.tex foobar-02.tex foobar-03.tex) ; foreach my $tex_file ( @files ) { ??? ??? write_file( $tex_file, "tex header\n" ) ; } learning perl should cover that just fine uri ... From rlharris at oplink.net Fri Jun 8 11:10:30 2018 From: rlharris at oplink.net (rlharris at oplink.net) Date: Fri, 8 Jun 2018 13:10:30 -0500 Subject: [pm-h] write to empty files In-Reply-To: References: <109d52e8f902404ba16662f1718ee4d4.squirrel@webmail.oplink.net> <4ecc7ece-b018-7dab-1823-02d2d4b57c9c@stemsystems.com> Message-ID: On Fri, June 8, 2018 12:48 pm, rlharris at oplink.net wrote: > On Fri, June 8, 2018 12:20 pm, Uri Guttman wrote: > >> use File::Slurp ; write_file( 'filename', "header text\n" ) ; >> append_file( 'filename', "more text\nand even more\n" ) ; > > I do not recall what structure is needed to feed to this code > a list of filenames, such as: > > foobar-01.tex foobar-02.tex foobar-03.tex ... Ultimately, I need to be able to write one or more different source files to each destination file: sourceA-01 to destination-01 sourceB-01 to destination-01 sourceA-02 to destination-02 sourceB-02 to destination-02 sourceA-03 to destination-03 sourceB-03 to destination-03 This can be done in separate batches for sourceA, sourceB, sourceC, and so forth. From rlharris at oplink.net Fri Jun 8 11:55:04 2018 From: rlharris at oplink.net (rlharris at oplink.net) Date: Fri, 8 Jun 2018 13:55:04 -0500 Subject: [pm-h] write to empty files In-Reply-To: References: <109d52e8f902404ba16662f1718ee4d4.squirrel@webmail.oplink.net> <4ecc7ece-b018-7dab-1823-02d2d4b57c9c@stemsystems.com> Message-ID: <2df50c2582b33b3dfd2c641ca614a9f0.squirrel@webmail.oplink.net> On Fri, June 8, 2018 1:01 pm, Uri Guttman wrote: > my @files = qw( foobar-01.tex foobar-02.tex foobar-03.tex) ; > > foreach my $tex_file ( @files ) { > > write_file( $tex_file, "tex header\n" ) ; > } I may have as many as a thousand "foobar-xx.tex" files. There must be a way to give "my @files" the name of a file containing target filenames. Is this something covered in "Learning Perl" ? From uri at stemsystems.com Fri Jun 8 12:31:12 2018 From: uri at stemsystems.com (Uri Guttman) Date: Fri, 8 Jun 2018 15:31:12 -0400 Subject: [pm-h] write to empty files In-Reply-To: <2df50c2582b33b3dfd2c641ca614a9f0.squirrel@webmail.oplink.net> References: <109d52e8f902404ba16662f1718ee4d4.squirrel@webmail.oplink.net> <4ecc7ece-b018-7dab-1823-02d2d4b57c9c@stemsystems.com> <2df50c2582b33b3dfd2c641ca614a9f0.squirrel@webmail.oplink.net> Message-ID: <9fe921f1-5a9c-0bd5-244c-9ef2f6fcfb61@stemsystems.com> On 06/08/2018 02:55 PM, rlharris at oplink.net wrote: > On Fri, June 8, 2018 1:01 pm, Uri Guttman wrote: >> my @files = qw( foobar-01.tex foobar-02.tex foobar-03.tex) ; >> >> foreach my $tex_file ( @files ) { >> >> write_file( $tex_file, "tex header\n" ) ; >> } > I may have as many as a thousand "foobar-xx.tex" files. There must be > a way to give "my @files" the name of a file containing target > filenames. Is this something covered in "Learning Perl" ? > _______________________________________________ File::Slurp to the rescue again! my @lex_files = read_file( 'file_with_tex_names' ) ; chomp @lex_files ; done! uri From cblanc at dionysius.com Fri Jun 8 17:18:08 2018 From: cblanc at dionysius.com (Chris Blanc) Date: Fri, 8 Jun 2018 19:18:08 -0500 Subject: [pm-h] write to empty files In-Reply-To: <9fe921f1-5a9c-0bd5-244c-9ef2f6fcfb61@stemsystems.com> References: <109d52e8f902404ba16662f1718ee4d4.squirrel@webmail.oplink.net> <4ecc7ece-b018-7dab-1823-02d2d4b57c9c@stemsystems.com> <2df50c2582b33b3dfd2c641ca614a9f0.squirrel@webmail.oplink.net> <9fe921f1-5a9c-0bd5-244c-9ef2f6fcfb61@stemsystems.com> Message-ID: You may want a file with source file and target file names, two on each line, separated by a tab. Read that in, then go through a loop which reads from the source and writes (as appropriate) to the targets. On Fri, Jun 8, 2018 at 2:31 PM, Uri Guttman wrote: > On 06/08/2018 02:55 PM, rlharris at oplink.net wrote: >> >> On Fri, June 8, 2018 1:01 pm, Uri Guttman wrote: >>> >>> my @files = qw( foobar-01.tex foobar-02.tex foobar-03.tex) ; >>> >>> foreach my $tex_file ( @files ) { >>> >>> write_file( $tex_file, "tex header\n" ) ; >>> } >> >> I may have as many as a thousand "foobar-xx.tex" files. There must be >> a way to give "my @files" the name of a file containing target >> filenames. Is this something covered in "Learning Perl" ? >> _______________________________________________ > > > File::Slurp to the rescue again! > > my @lex_files = read_file( 'file_with_tex_names' ) ; > chomp @lex_files ; > > done! > > uri > _______________________________________________ > Houston mailing list > Houston at pm.org > http://mail.pm.org/mailman/listinfo/houston > Website: http://houston.pm.org/ -- http://www.dionysius.com/ From cblanc at dionysius.com Sat Jun 9 06:32:41 2018 From: cblanc at dionysius.com (Chris Blanc) Date: Sat, 9 Jun 2018 08:32:41 -0500 Subject: [pm-h] write to empty files In-Reply-To: <109d52e8f902404ba16662f1718ee4d4.squirrel@webmail.oplink.net> References: <109d52e8f902404ba16662f1718ee4d4.squirrel@webmail.oplink.net> Message-ID: I did something similar when I wrote an experimental hypertext book. It turned out that using Perl to parse a source text file with simple markup was the solution. Would something like that work for you? On Fri, Jun 8, 2018 at 12:11 PM, wrote: > On Fri, June 8, 2018 7:54 am, Chris Blanc wrote: >> I would write-append these lines to the file with the >> operator. >> >> >> I would use this for the pathname: >> http://perldoc.perl.org/File/Basename.html >> >> >> This might help with the timestamp: >> https://www.perl.com/pub/2003/03/13/datetime.html/ > > "touch" changes the timestamp of a file, but also creates non-existent > files, and a file created by touch has zero length. > > I have been using touch in a bash script to create groups of files simply > because it is an easy approach, and it has been years since I last did a > cover-to-cover read of Learning Perl. But then the contents of each file > must be created manually by copy-and-paste. > > I would prefer to use Perl to create the files with the desired headers. > Once I know how to do that, I can make use of Perl to add additional > file-specific material to each file, and save much time in manual editing. > > RLH > _______________________________________________ > Houston mailing list > Houston at pm.org > http://mail.pm.org/mailman/listinfo/houston > Website: http://houston.pm.org/ -- http://www.dionysius.com/ From rlharris at oplink.net Sat Jun 9 12:51:41 2018 From: rlharris at oplink.net (rlharris at oplink.net) Date: Sat, 9 Jun 2018 14:51:41 -0500 Subject: [pm-h] write to empty files Message-ID: On Sat, June 9, 2018 8:32 am, Chris Blanc wrote: > I did something similar when I wrote an experimental hypertext book. > It turned out that using Perl to parse a source text file with simple > markup was the solution. Would something like that work for you? I am attempting to write a chapter-by-chapter survey of the Scripture. The survey is to be published in the form of articles in both HTML and PDF, posted to the WWW for free, no-charge download. For each of the roughly 1200 chapters in the Bible it is necessary to bring together in one document [A] the Scripture text (Greek), [B] the English translation of the Scripture text, and [C] an analysis of the chapter (which is the part I write). Parsing [A] and [B] is not an issue; it is easy to place each chapter (Greek or the English translation) into a separate file. And each chapter analysis [C] is composed as a separate file. Thus, I have three source directories (Greek, English translation, analysis), each of which contains roughly 1200 files. A fourth directory contains the destination files, to which LaTeX markup subsequently is added prior to publication. The need is to create the set of approximately 1200 destination files. To create each destination file, the corresponding source file is copied from [A], [B], and [C]: sourceA-0001.tex to destination-0001.tex sourceB-0001.tex to destination-0001.tex sourceC-0001.tex to destination-0001.tex sourceA-0002.tex to destination-0002.tex sourceB-0002.tex to destination-0002.tex sourceC-0002.tex to destination-0002.tex ... sourceA-1189.tex to destination-1189.tex sourceB-1189.tex to destination-1189.tex sourceC-1189.tex to destination-1189.tex Automating the creation of destination files not only saves time in the original compilation, but also facilitates revisions of the commentary, as well as change from one English translation to another. From cblanc at dionysius.com Sun Jun 10 14:06:55 2018 From: cblanc at dionysius.com (Chris Blanc) Date: Sun, 10 Jun 2018 16:06:55 -0500 Subject: [pm-h] write to empty files In-Reply-To: References: Message-ID: Sounds like a fun project. If I recall correctly, you had mentioned also wanting a custom header in each output file; what would that be? Also, how do you want to delimit A, B, and C in the output? Chris On Sat, Jun 9, 2018 at 2:51 PM, wrote: > On Sat, June 9, 2018 8:32 am, Chris Blanc wrote: >> I did something similar when I wrote an experimental hypertext book. >> It turned out that using Perl to parse a source text file with simple >> markup was the solution. Would something like that work for you? > > I am attempting to write a chapter-by-chapter survey of the Scripture. The > survey is to be published in the form of articles in both HTML and PDF, > posted to the WWW for free, no-charge download. > > For each of the roughly 1200 chapters in the Bible it is necessary to > bring together in one document [A] the Scripture text (Greek), [B] the > English translation of the Scripture text, and [C] an analysis of the > chapter (which is the part I write). > > Parsing [A] and [B] is not an issue; it is easy to place each chapter > (Greek or the English translation) into a separate file. And each chapter > analysis [C] is composed as a separate file. Thus, I have three source > directories (Greek, English translation, analysis), each of which contains > roughly 1200 files. A fourth directory contains the destination files, to > which LaTeX markup subsequently is added prior to publication. > > The need is to create the set of approximately 1200 destination files. To > create each destination file, the corresponding source file is copied from > [A], [B], and [C]: > > sourceA-0001.tex to destination-0001.tex > sourceB-0001.tex to destination-0001.tex > sourceC-0001.tex to destination-0001.tex > > sourceA-0002.tex to destination-0002.tex > sourceB-0002.tex to destination-0002.tex > sourceC-0002.tex to destination-0002.tex > > ... > > sourceA-1189.tex to destination-1189.tex > sourceB-1189.tex to destination-1189.tex > sourceC-1189.tex to destination-1189.tex > > Automating the creation of destination files not only saves time in the > original compilation, but also facilitates revisions of the commentary, as > well as change from one English translation to another. > _______________________________________________ > Houston mailing list > Houston at pm.org > http://mail.pm.org/mailman/listinfo/houston > Website: http://houston.pm.org/ -- http://www.dionysius.com/ From rlharris at oplink.net Sun Jun 17 00:27:15 2018 From: rlharris at oplink.net (rlharris at oplink.net) Date: Sun, 17 Jun 2018 02:27:15 -0500 Subject: [pm-h] write to empty files In-Reply-To: References: Message-ID: On Sun, June 10, 2018 4:06 pm, Chris Blanc wrote: > Sounds like a fun project. If I recall correctly, you had mentioned > also wanting a custom header in each output file; what would that be? Also, > how do you want to delimit A, B, and C in the output? Here is the task as I see it now. In general, all that is required is: (a) traversal of a directory, operating on each file in the directory, (b) use of the filename as the key to obtain one or more values from a look-up table, and (c) writing to the file the value or values obtained from the look-up table. ---------------------------------------------------------------------- This one-time task produces approximately twelve hundred sets of document templates -- one set for each chapter of the English Bible. Each set consists of four LaTeX files, one of which is the master which has include statements which specify the other three files. When complete, each document is the analysis of a single chapter, and may be revised and published independently of the other documents. ---------------------------------------------------------------------- (Step 1) Populate four directories ("greek", "english", "exposition", "publication") with files which initially are empty except for an identifying header: % filename % timestamp % projectname % bookname-common % chapternumber where: "filename" is of the form: greek-xx-yyy.tex (The Greek text.) english-xx-yyy.tex (The English translation.) exposition-xx-yyy.tex (The part which I write.) publication-xx-yyy.tex (The LaTeX document, which (via "\include" statements) incorporates the text of the corresponding "greek", "english", and "exposition" files.) xx, the "booknumber", ranges from 01 to 66. yyy, the "chapternumber", ranges from 001 to 150; three digits are used, because the book of Psalms has 150 chapters. ".tex" indicates that the file contains LaTeX markup. "timestamp" is taken from the clock of the computer, with format "2018.06.15 1400gmt". "projectname" is the string "survey". "bookname-common" is the common form of the book name, obtained from a look-up table. "chapternumber" yyy is obtained from the filename. Accordingly: greek-01-001.tex appertains to Genesis chapter 1 english-19-127.tex appertains to Psalm 127 exposition-28-004.tex appertains to Hosea chapter 4 publication-47-012.tex appertains to II Corinthians chapter 12 A 66-line look-up table provides the following values for each of the 66 books of the English Bible: bookname-common bookname-formal chaptercount "bookname-common" is used in the identification header files of all four categories ("greek", "english", "exposition", and "publication"). "bookname-formal" is used only in the LaTeX header of "publication" files. "chaptercount" is included in the look-up table, so that file creation can be automated. ---------------------------------------------------------------------- (Step 2) Copy to each "publication" file a LaTeX preamble. The same preamble is used for each publication file, but within the preamble are several labeled fields into which a number or a string needs to be written; for example: bookname chapter revisiondate "bookname" is the formal bookname, obtained from the look-up table. "chapter" is the "chapternumber", obtained from the filename, but stripped of leading zeroes. "revisiondate" is a fixed string ("date monthname year") which indicates the official revision date. ---------------------------------------------------------------------- (Step 3) Write to each "publication" file three LaTeX include statements which specify the filenames for the corresponding "greek", "english", and "exposition" files: \include greek-xx-yyy \include english-xx-yyy \include exposition-xx-yyy No ".tex" suffix appears, because the include statement assumes a ".tex" file. ---------------------------------------------------------------------- (Step 4) One or more additional Perl scripts are needed to process source files from which the "english" and "greek" files are created. The source files are: (1) English translation of the Bible (either the King James Version or else Young's Literal Translation). (2) Greek text of the Bible (either in native Greek or else in English transliteration.) The processing: (1) Removes or replaces artifacts, including non-LaTeX markup. (2) Adds required LaTeX markup. (3) Parses the source file (if it is monolithic) into chapter files. ----------------------------------------------------------------------