Skip to content

Added fixed width source adapter#140

Open
LeonB wants to merge 1 commit intoho-nl:masterfrom
tim-online:master
Open

Added fixed width source adapter#140
LeonB wants to merge 1 commit intoho-nl:masterfrom
tim-online:master

Conversation

@LeonB
Copy link
Copy Markdown

@LeonB LeonB commented Dec 15, 2016

Config can be like this:

<source model="ho_import/source_adapter_fixedwidth">
    <file>var/import/fixedwidth.txt</file>

    <trim>1</trim>
    <columns>
        <col1>8</col1>
        <col2>4</col2>
        <col3>12</col3>
        <col4>13</col4>
        <col5>27</col5>
        <col6>5</col6>
        <col7>4</col7>
        <col8>9</col8>
        <col9>4</col9>
        <col10>18</col10>
        <col11>20</col11>
        <col12></col12> <!-- to end of line -->
    </columns>
</source>

This will be the data generated based on fixedwidth.txt.

+-------+------------+
| key   | 0          |
+-------+------------+
| col1  | 16524      |
| col2  | 01         |
| col3  | 10/17/2012 |
| col4  | 3930621977 |
| col5  | TXNPUES    |
| col6  | S1         |
| col7  | Yes        |
| col8  | RHMXWPCP   |
| col9  | Yes        |
| col10 |            |
| col11 | 5,007.10   |
| col12 | No         |
+-------+------------+

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant