Using the list-of-cases-volume-1.txt (with line numbers stripped and saved as cases2.txt), the output is:
Some of the input lines (4176 out of 12861 lines) were for duplicate case names, so i modified the script above to append the extra lines for that case to the existing file, with -=-=-=-=-=-=-=-= as separator.
Some of the case titles were too long to be used as a filename, so i usedUsing substr($_,0,200)Lambert* to limit the filename to the first 200 characters. Another alternative, which would result in non- human-sensible filenames would be to use the md5sum hash of the case namecases as the filename. The case name would still be in the first line of the file.examples) is:
$ mkdir -p out/
$ ./hef.pl cases2.txt
Using Lambert* cases as example:
$ ls -1 out/Lambert*
out/Lambert v Aeretree 1 Lord Raymond 223, 91 ER 1045.txt
out/Lambert v Atkins and Another 2 Campbell 272, 170 ER 1153.txt
out/Lambert v Cook 1 Lord Raymond 237, 91 ER 1055.txt
out/Lambert v Oakes 1 Lord Raymond 443, 91 ER 1194.txt
out/Lambert v Pack 1 Salkeld 127, 91 ER 120.txt
out/Lambert v Peyton [1860] 7 House of Lords Cases 423, 11 ER 169.txt
Some of the input lines (4176 out of 12861 lines) were for duplicate case names, so i modified the script above to append the extra lines for that case to the existing file, with -=-=-=-=-=-=-=-= as separator.
Some of the case titles were too long to be used as a filename, so i used substr($_,0,200) to limit the filename to the first 200 characters. Another alternative, which would result in non- human-sensible filenames would be to use the md5sum hash of the case name as the filename. The case name would still be in the first line of the file.