Hide last authors
Outhman Moustaghfir 9.1 1 = =
2
Outhman Moustaghfir 5.1 3 = SplitFile Connector Documentation =
4
5 == Overview ==
6
7 [[image:1723111201862-594.png]]
8
Outhman Moustaghfir 6.2 9 The splitFile connector is a utility designed to split files based on specific configurations defined in an XML format. The connector supports two modes of operation: **line** and **message **mode. Below is the functional documentation for each mode, including the expected format file, sample input file, and corresponding output files.
Outhman Moustaghfir 5.1 10
11 == Usage ==
12
13 == Xml Format ==
14
15
16 {{{
17 }}}
18
19 {{code language="XML"}}
20
21 <ixDOC xmlns:ixf="http://www.ixPath.com/Function"
22 xmlns:xs="http://www.w3.org/2001/XMLSchema"
23 xmlns:ix="localFunction"
24 xmlns:fn="http://www.w3.org/2005/xpath-functions">
25
Outhman Moustaghfir 7.1 26 <SplitBy mode="" headers="" footers="" excluded="" included="" endLine="" position ="" size="" optionChar="" ></SplitBy>
Outhman Moustaghfir 5.1 27 </ixDOC>
28
29 {{/code}}
30
31
32
33
34 === Key Attributes: ===
35
36 * **Headers and Footers:** Specify header and footer lines to be included in each output file.
Outhman Moustaghfir 6.4 37 * **endLine:** Define the character used to separate lines in the file, default value is newLine char.
Outhman Moustaghfir 6.5 38 * (((
39 **optionChar : **Define the character used to separate lines in output file, default value is newLine char.
40 )))
Outhman Moustaghfir 8.1 41 * **included :** Include specific lines from the output by defining them in the include attribute.
Outhman Moustaghfir 6.4 42 * **excluded:** Exclude specific lines from the output by defining them in the exclude attribute.
43 * **Position and Size:** Used to locate and define the include in the input file.
Outhman Moustaghfir 5.1 44
Outhman Moustaghfir 7.1 45 === 1. Mode: line ===
Outhman Moustaghfir 5.1 46
47
Outhman Moustaghfir 6.1 48 === Input File Example : ===
Outhman Moustaghfir 5.1 49
50
51 {{code language="txt"}}
52 UNA +.? '
53 UNB+UNOD 3+5907613200009 14+5907808850002 14+240509 1553+11480134402++DESADV'
54 UNH+22865910+DESADV D 96A UN EAN005'
55 BGM+351+5103742405090001+9'
56 DTM+137 20240509 102'
57 DTM+2 20240509 102'
58 DTM+17 20240509 102'
59 RFF+DQ 5103742405090001'
60 DTM+171 20240509 102'
61 RFF+ON 0136811328'
62 NAD+BY+5907808850002 9++CASTORAMA POLSKA SP. Z O.O.+UL. KRAKOWIAKÓW 78+WARSZAWA++02-255+PL'
63 NAD+SU+5907613200009 9++TEMARED SPÓŁKA Z OGRANICZONĄ ODPOWI EDZIALNOŚCIĄ+al. Lotników Polskich 1+Świdnik++21-040+PL'
64 NAD+DP+5908305680970 9++CASTORAMA PIŁA+UL. BYDGOSKA 135+Piła++64-920+PL'
65 NAD+FW+5907613200009 9'
66 CPS+1'
67 LIN+1++5907640254112 EN'
68 PIA+1+S1OVZ.075.201.126.522_M SA'
69 QTY+12 2.00 EA'
70 QTY+52 1 EA'
71 RFF+LI 00001'
72 RFF+ON 0136811328'
73 LIN+2++5907640254150 EN'
74 PIA+1+S1OVZ.075.201.106.511_M SA'
75 QTY+12 2.00 EA'
76 QTY+52 1 EA'
77 RFF+LI 00002'
78 RFF+ON 0136811328'
79 LIN+3++5907640254426 EN'
80 PIA+1+S2OVZ.075.264.126.524_M SA'
81 QTY+12 2.00 EA'
82 QTY+52 1 EA'
83 RFF+LI 00003'
84 RFF+ON 0136811328'
85 LIN+4++5907640254617 EN'
86 PIA+1+S1OVZ.075.230.126.523_M SA'
87 QTY+12 2.00 EA'
88 QTY+52 1 EA'
89 RFF+LI 00004'
90 RFF+ON 0136811328'
91 LIN+5++5907640254624 EN'
92 PIA+1+S1OVZ.075.201.106.511_USNE SA'
93 QTY+12 1.00 EA'
94 QTY+52 1 EA'
95 RFF+LI 00005'
96 RFF+ON 0136811328'
97 CNT+2 5'
98 UNH+22865910+DESADV D 96A UN EAN005'
99 BGM+351+5103742405090001+9'
100 DTM+137 20240509 102'
101 DTM+2 20240509 102'
102 DTM+17 20240509 102'
103 RFF+DQ 5103742405090001'
104 DTM+171 20240509 102'
105 RFF+ON 0136811328
106 NAD+BY+5907808850002 9++CASTORAMA POLSKA SP. Z O.O.+UL. KRAKOWIAKÓW 78+WARSZAWA++02-255+PL'
107 NAD+SU+5907613200009 9++TEMARED SPÓŁKA Z OGRANICZONĄ ODPOWI EDZIALNOŚCIĄ+al. Lotników Polskich 1+Świdnik++21-040+PL'
108 NAD+DP+5908305680970 9++CASTORAMA PIŁA+UL. BYDGOSKA 135+Piła++64-920+PL'
109 NAD+FW+5907613200009 9'
110 CPS+1'
111 LIN+1++5907640254112 EN'
112 PIA+1+S1OVZ.075.201.126.522_M SA'
113 QTY+12 2.00 EA'
114 QTY+52 1 EA'
115 RFF+LI 00001'
116 RFF+ON 0136811328'
117 LIN+2++5907640254150 EN'
118 PIA+1+S1OVZ.075.201.106.511_M SA'
119 QTY+12 2.00 EA'
120 QTY+52 1 EA'
121 RFF+LI 00002'
122 RFF+ON 0136811328'
123 LIN+3++5907640254426 EN'
124 PIA+1+S2OVZ.075.264.126.524_M SA'
125 QTY+12 2.00 EA'
126 QTY+52 1 EA'
127 RFF+LI 00003'
128 RFF+ON 0136811328'
129 LIN+4++5907640254617 EN'
130 PIA+1+S1OVZ.075.230.126.523_M SA'
131 QTY+12 2.00 EA'
132 QTY+52 1 EA'
133 RFF+LI 00004'
134 RFF+ON 0136811328'
135 LIN+5++5907640254624 EN'
136 PIA+1+S1OVZ.075.201.106.511_USNE SA'
137 QTY+12 1.00 EA'
138 QTY+52 1 EA'
139 RFF+LI 00005'
140 RFF+ON 0136811328'
141 CNT+2 5'
142 UNH+22865910+DESADV D 96A UN EAN005'
143 BGM+351+5103742405090001+9'
144 DTM+137 20240509 102'
145 DTM+2 20240509 102'
146 DTM+17 20240509 102'
147 RFF+DQ 5103742405090001'
148 DTM+171 20240509 102'
149 RFF+ON 0136811328'
150 NAD+BY+5907808850002 9++CASTORAMA POLSKA SP. Z O.O.+UL. KRAKOWIAKÓW 78+WARSZAWA++02-255+PL'
151 NAD+SU+5907613200009 9++TEMARED SPÓŁKA Z OGRANICZONĄ ODPOWI EDZIALNOŚCIĄ+al. Lotników Polskich 1+Świdnik++21-040+PL'
152 NAD+DP+5908305680970 9++CASTORAMA PIŁA+UL. BYDGOSKA 135+Piła++64-920+PL'
153 NAD+FW+5907613200009 9'
154 CPS+1'
155 LIN+1++5907640254112 EN'
156 PIA+1+S1OVZ.075.201.126.522_M SA'
157 QTY+12 2.00 EA'
158 QTY+52 1 EA'
159 RFF+LI 00001'
160 RFF+ON 0136811328'
161 LIN+2++5907640254150 EN'
162 PIA+1+S1OVZ.075.201.106.511_M SA'
163 QTY+12 2.00 EA'
164 QTY+52 1 EA'
165 RFF+LI 00002'
166 RFF+ON 0136811328'
167 LIN+3++5907640254426 EN'
168 PIA+1+S2OVZ.075.264.126.524_M SA'
169 QTY+12 2.00 EA'
170 QTY+52 1 EA'
171 RFF+LI 00003'
172 RFF+ON 0136811328'
173 LIN+4++5907640254617 EN'
174 PIA+1+S1OVZ.075.230.126.523_M SA'
175 QTY+12 2.00 EA'
176 QTY+52 1 EA'
177 RFF+LI 00004'
178 RFF+ON 0136811328'
179 LIN+5++5907640254624 EN'
180 PIA+1+S1OVZ.075.201.106.511_USNE SA'
181 QTY+12 1.00 EA'
182 QTY+52 1 EA'
183 RFF+LI 00005'
184 RFF+ON 0136811328'
185 CNT+2 5'
186 UNH+22865910+DESADV D 96A UN EAN005'
187 BGM+351+5103742405090001+9'
188 DTM+137 20240509 102'
189 DTM+2 20240509 102'
190 DTM+17 20240509 102'
191 RFF+DQ 5103742405090001'
192 DTM+171 20240509 102'
193 RFF+ON 0136811328'
194 NAD+BY+5907808850002 9++CASTORAMA POLSKA SP. Z O.O.+UL. KRAKOWIAKÓW 78+WARSZAWA++02-255+PL'
195 NAD+SU+5907613200009 9++TEMARED SPÓŁKA Z OGRANICZONĄ ODPOWI EDZIALNOŚCIĄ+al. Lotników Polskich 1+Świdnik++21-040+PL'
196 NAD+DP+5908305680970 9++CASTORAMA PIŁA+UL. BYDGOSKA 135+Piła++64-920+PL'
197 NAD+FW+5907613200009 9'
198 CPS+1'
199 LIN+1++5907640254112 EN'
200 PIA+1+S1OVZ.075.201.126.522_M SA'
201 QTY+12 2.00 EA'
202 QTY+52 1 EA'
203 RFF+LI 00001'
204 RFF+ON 0136811328'
205 LIN+2++5907640254150 EN'
206 PIA+1+S1OVZ.075.201.106.511_M SA'
207 QTY+12 2.00 EA'
208 QTY+52 1 EA'
209 RFF+LI 00002'
210 RFF+ON 0136811328'
211 LIN+3++5907640254426 EN'
212 PIA+1+S2OVZ.075.264.126.524_M SA'
213 QTY+12 2.00 EA'
214 QTY+52 1 EA'
215 RFF+LI 00003'
216 RFF+ON 0136811328'
217 LIN+4++5907640254617 EN'
218 PIA+1+S1OVZ.075.230.126.523_M SA'
219 QTY+12 2.00 EA'
220 QTY+52 1 EA'
221 RFF+LI 00004'
222 RFF+ON 0136811328'
223 LIN+5++5907640254624 EN'
224 PIA+1+S1OVZ.075.201.106.511_USNE SA'
225 QTY+12 1.00 EA'
226 QTY+52 1 EA'
227 RFF+LI 00005'
228 RFF+ON 0136811328'
229 CNT+2 5'
230 UNH+22865910+DESADV D 96A UN EAN005'
231 BGM+351+5103742405090001+9'
232 DTM+137 20240509 102'
233 DTM+2 20240509 102'
234 DTM+17 20240509 102'
235 RFF+DQ 5103742405090001'
236 DTM+171 20240509 102'
237 RFF+ON 0136811328'
238 NAD+BY+5907808850002 9++CASTORAMA POLSKA SP. Z O.O.+UL. KRAKOWIAKÓW 78+WARSZAWA++02-255+PL'
239 NAD+SU+5907613200009 9++TEMARED SPÓŁKA Z OGRANICZONĄ ODPOWI EDZIALNOŚCIĄ+al. Lotników Polskich 1+Świdnik++21-040+PL'
240 NAD+DP+5908305680970 9++CASTORAMA PIŁA+UL. BYDGOSKA 135+Piła++64-920+PL'
241 NAD+FW+5907613200009 9'
242 CPS+1'
243 LIN+1++5907640254112 EN'
244 PIA+1+S1OVZ.075.201.126.522_M SA'
245 QTY+12 2.00 EA'
246 QTY+52 1 EA'
247 RFF+LI 00001'
248 RFF+ON 0136811328'
249 LIN+2++5907640254150 EN'
250 PIA+1+S1OVZ.075.201.106.511_M SA'
251 QTY+12 2.00 EA'
252 QTY+52 1 EA'
253 RFF+LI 00002'
254 RFF+ON 0136811328'
255 LIN+3++5907640254426 EN'
256 PIA+1+S2OVZ.075.264.126.524_M SA'
257 QTY+12 2.00 EA'
258 QTY+52 1 EA'
259 RFF+LI 00003'
260 RFF+ON 0136811328'
261 LIN+4++5907640254617 EN'
262 PIA+1+S1OVZ.075.230.126.523_M SA'
263 QTY+12 2.00 EA'
264 QTY+52 1 EA'
265 RFF+LI 00004'
266 RFF+ON 0136811328'
267 LIN+5++5907640254624 EN'
268 PIA+1+S1OVZ.075.201.106.511_USNE SA'
269 QTY+12 1.00 EA'
270 QTY+52 1 EA'
271 RFF+LI 00005'
272 RFF+ON 0136811328'
273 CNT+2 5'
274 UNZ+1+11480134402'
275 UNZ1'
276 '
277 {{/code}}
278
279
Outhman Moustaghfir 7.1 280 ==== Example 1: without specifying include attribute ====
Outhman Moustaghfir 5.1 281
Outhman Moustaghfir 7.1 282 when we don't use include attribute. it means for each output file we are going to have headers and footers and also for the include we will defined them by position and size so for each line at a specific position and with a size this is the include .
Outhman Moustaghfir 5.1 283
284 {{{
285 }}}
286
287 {{code language="XML"}}
288
289 <ixDOC xmlns:ixf="http://www.ixPath.com/Function"
290 xmlns:xs="http://www.w3.org/2001/XMLSchema"
291 xmlns:ix="localFunction"
292 xmlns:fn="http://www.w3.org/2005/xpath-functions">
293
Outhman Moustaghfir 7.1 294 <SplitBy mode="line" headers="UNA;UNB" footers="UNZ1;UNZ" excluded="QTY" include ="" endLine="'" position ="25" size="9"></SplitBy>
Outhman Moustaghfir 5.1 295 </ixDOC>
296
297 {{/code}}
298
Outhman Moustaghfir 6.1 299 == output files : ==
Outhman Moustaghfir 5.1 300
301 [[image:1723112876572-265.png]]
302
303
304 fileName_1_ //**UN EAN00**//.txt
305
306
307 {{code language="txt"}}
308 UNA +.? '
309 UNB+UNOD 3+5907613200009 14+5907808850002 14+240509 1553+11480134402++DESADV'
310 UNH+22865910+DESADV D 96A UN EAN005'
311 UNH+22865910+DESADV D 96A UN EAN005'
312 UNH+22865910+DESADV D 96A UN EAN005'
313 UNH+22865910+DESADV D 96A UN EAN005'
314 UNH+22865910+DESADV D 96A UN EAN005'
315 UNZ+1+11480134402'
316 UNZ1'
317
318 {{/code}}
319
Outhman Moustaghfir 7.1 320 == Example 2: with specifiying include attribute ==
Outhman Moustaghfir 5.1 321
322 we don't need to use position and size.
323
Outhman Moustaghfir 7.1 324 == 2. Mode: message: ==
Outhman Moustaghfir 5.1 325
Outhman Moustaghfir 7.1 326 In **message** mode, the file is split into sections based on a specified include . Each output file begins with the start of an include and ends when another include is encountered.
Outhman Moustaghfir 5.1 327
328
329 ==== Example ====
330
331
332 {{code language="xml"}}
333
334 <ixDOC xmlns:ixf="http://www.ixPath.com/Function"
335 xmlns:xs="http://www.w3.org/2001/XMLSchema"
336 xmlns:ix="localFunction"
337 xmlns:fn="http://www.w3.org/2005/xpath-functions">
338
Outhman Moustaghfir 7.1 339 <SplitBy mode="message" headers="UNA;UNB" footers="UNZ1;UNZ" excluded="QTY" include ="UNH" endLine="'"></SplitBy>
Outhman Moustaghfir 5.1 340 </ixDOC>
341
342 {{/code}}
343
344 === an example of an output file ===
345
Outhman Moustaghfir 9.1 346
Outhman Moustaghfir 5.1 347 {{code language="xml"}}
348 UNA +.? '
349 UNB+UNOD 3+5907613200009 14+5907808850002 14+240509 1553+11480134402++DESADV'
350 UNH+22865910+DESADV D 96A UN EAN005'
351 BGM+351+5103742405090001+9'
352 DTM+137 20240509 102'
353 DTM+2 20240509 102'
354 DTM+17 20240509 102'
355 RFF+DQ 5103742405090001'
356 DTM+171 20240509 102'
357 RFF+ON 0136811328'
358 NAD+BY+5907808850002 9++CASTORAMA POLSKA SP. Z O.O.+UL. KRAKOWIAKÓW 78+WARSZAWA++02-255+PL'
359 NAD+SU+5907613200009 9++TEMARED SPÓŁKA Z OGRANICZONĄ ODPOWI EDZIALNOŚCIĄ+al. Lotników Polskich 1+Świdnik++21-040+PL'
360 NAD+DP+5908305680970 9++CASTORAMA PIŁA+UL. BYDGOSKA 135+Piła++64-920+PL'
361 NAD+FW+5907613200009 9'
362 CPS+1'
363 LIN+1++5907640254112 EN'
364 PIA+1+S1OVZ.075.201.126.522_M SA'
365 RFF+LI 00001'
366 RFF+ON 0136811328'
367 LIN+2++5907640254150 EN'
368 PIA+1+S1OVZ.075.201.106.511_M SA'
369 RFF+LI 00002'
370 RFF+ON 0136811328'
371 LIN+3++5907640254426 EN'
372 PIA+1+S2OVZ.075.264.126.524_M SA'
373 RFF+LI 00003'
374 RFF+ON 0136811328'
375 LIN+4++5907640254617 EN'
376 PIA+1+S1OVZ.075.230.126.523_M SA'
377 RFF+LI 00004'
378 RFF+ON 0136811328'
379 LIN+5++5907640254624 EN'
380 PIA+1+S1OVZ.075.201.106.511_USNE SA'
381 RFF+LI 00005'
382 RFF+ON 0136811328'
383 CNT+2 5'
384 UNZ+1+11480134402'
385 UNZ1'
386
387 {{/code}}
388
Outhman Moustaghfir 10.1 389 ==== Other Examples : ====
Outhman Moustaghfir 9.1 390
391
392 {{code language="xml"}}
393 <!-- Write a file for each type of segment -->
Outhman Moustaghfir 10.1 394 <SplitBy mode="line" headers="UNA;UNB" footers="UNZ" excluded="UNA;UNB;UNZ" included="" size="3" position="1" endLine="'" optionChar="\r\n" ></SplitBy>
Outhman Moustaghfir 9.1 395
396 <!-- Write a file for each type of record where the line identifier (Position 1 to 8) is different -->
Outhman Moustaghfir 10.1 397 <SplitBy mode="line" size="8" position="1" ></SplitBy> <!-- The default endLine is the carriage return -->
Outhman Moustaghfir 9.1 398
399 <!-- Write a file for each message starting with UNH with repeated envelope for each -->
Outhman Moustaghfir 10.1 400 <SplitBy mode="message" headers="UNA;UNB" footers="UNZ" excluded="" included="" size="3" position="1" endLine="'" optionChar="\r\n" ></SplitBy>
Outhman Moustaghfir 9.1 401 {{/code}}
402
Outhman Moustaghfir 6.1 403 === ===
This wiki is hosted and managed by iXPath
Powered by XWiki 13.3 debian