-
Notifications
You must be signed in to change notification settings - Fork 0
/
etl.xml
34 lines (33 loc) · 1.18 KB
/
etl.xml
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
29
30
31
32
33
34
<!DOCTYPE etl SYSTEM "http://scriptella.javaforge.com/dtd/etl.dtd">
<etl>
<connection id="java" driver="janino"/>
<connection id="in1" driver="text" url="TAXNUM.DAT"/>
<script connection-id="java">
import java.io.*;
import org.apache.commons.compress.archivers.sevenz.*;
SevenZFile sevenZFile = new SevenZFile(new File("TAXNUM.7z"));
SevenZArchiveEntry entry = sevenZFile.getNextEntry();
while(entry!=null){
FileOutputStream out = new FileOutputStream(entry.getName());
byte[] content = new byte[(int) entry.getSize()];
sevenZFile.read(content, 0, content.length);
out.write(content);
out.close();
entry = sevenZFile.getNextEntry();
}
sevenZFile.close();
</script>
<query connection-id="in1">
^(.{45}) (.{30}) (.)([CFGKOPSV]) (.{12}) ( ) (.{3}) (\d{6})$
<script connection-id="java">
import redis.clients.jedis.*;
Jedis j = JedisSingleton.getInstance();
j.set(get("8").toString(),get("1").toString().trim());
</script>
</query>
<script connection-id="java">
import redis.clients.jedis.*;
Jedis j = JedisSingleton.getInstance();
j.close();
</script>
</etl>