-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathprocess_files.php
More file actions
28 lines (23 loc) · 958 Bytes
/
process_files.php
File metadata and controls
28 lines (23 loc) · 958 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
<?php
/* This file uses the function in parse_trademarks to
parse a succession of files. The loop here is for the
set of files the USPTO dated 12/31/2015, which seems
to be (USPTO documentation somewhat lacking) trademarks
filed prior to that date. There are also daily files
for most days in 2016, which this does not parse.
(c) 2016 Joseph Morris joe at morris dot cloud
Permission to use under the MIT license https://opensource.org/licenses/MIT
*/
include_once ("./parse_trademarks.php");
for ($x = 1; $x <= 53; $x++) {
$x_str = str_pad ( (string)$x, 2, '0', STR_PAD_LEFT );
$zipname = "apc151231-".$x_str.".zip";
$xmlname = "apc151231-".$x_str.".xml";
echo ("Unzipping " . $zipname. "\n");
exec ( "unzip ./data/$zipname -d ./data" );
load_txml_file ( "./data/".$xmlname, $database );
// Files are quite large when expanded, so deleting
// the expanded xml when done. Zip file stays.
unlink ( "./data/" . $xmlname );
}
?>