Import CSV with AVReporter v4.0 (64 bit ODBC driver)

Discussion in 'AVReporter Connection Center' started by Baracskai Attila, Feb 18, 2016.

  1. Baracskai Attila

    Baracskai Attila Administrator

    Import CSV file: DBM_adatok.csv
  2. Baracskai Attila

    Baracskai Attila Administrator

    First step create shema file: schema.ini

    [DBM_adatok.csv]
    ColNameHeader=True
    Format=Delimited(;)
    DateTimeFormat=yyyy.mm.dd. hh:nn
    Col1=NameSpaceName Char Width 400
    Col2=TimeStamp Date
    Col3=DeviceName Char Width 250
    Col4=QunatityName Char Width 200
    Col5=Unit Char Width 200
    Col6=Value Float

    Copy to CSV file

    upload_2016-2-18_11-12-30.png
  3. Baracskai Attila

    Baracskai Attila Administrator

    Open AVReporter v4.0 with Administrator privilages:

    upload_2016-2-18_11-15-36.png
  4. Baracskai Attila

    Baracskai Attila Administrator

    Open AVR Connection Center:

    upload_2016-2-18_11-16-51.png
  5. Baracskai Attila

    Baracskai Attila Administrator

    Create new Job:

    upload_2016-2-18_11-17-43.png
  6. Baracskai Attila

    Baracskai Attila Administrator

    Shows Advanced settings:

    upload_2016-2-18_11-18-58.png
  7. Baracskai Attila

    Baracskai Attila Administrator

    - Set connection string
    - Create new configuration

    upload_2016-2-18_11-21-16.png
  8. Baracskai Attila

    Baracskai Attila Administrator

  9. Baracskai Attila

    Baracskai Attila Administrator

    Select CSV file:

    upload_2016-2-18_11-23-39.png
  10. Baracskai Attila

    Baracskai Attila Administrator

    Define importing process position (last record):

    upload_2016-2-18_11-25-14.png

    upload_2016-2-18_11-26-32.png

    More details from AVReporter knowledgebase:
    "Use feature Remember processed records to avoid the need to loop through rows of the source table that have already been processed at every execution. This can save much time when dealing with large amounts of data. You need to specify a column holding incremental (but not necessarily unique) values so if another record is added to the table it will have a value in this field that is greater than those of older records. Automatically incrementing IDs (AUTO_INCREMENT, IDENTITY) or columns containing the timestamps when rows have been added usually qualify as incremental.
    This setting causes the plugin to record the value from the selected column of the last processed source row and will only load rows having a value equal to or greater than this in their corresponding column the next time it executes. This also means that adding new rows to the source table with a less value in this field (denoting the column isn't actually incremental) leads to the plugin never processing it as it believes it already has.
    The software suspends remembering records if it encounters an error during an insert operation so that on next execution it can continue working with the row that could not have been processed because of the error. This may make it reasonable to use a Retry count greater than zero or turn Stop data transfer on error on so the plugin won't spend time processing further rows as they will have to be iterated through on next run anyway beacuse they wouldn't be remembered.
    Clicking Reset feature clears information on the last remembered row so next time the entire source table will be loaded again. Selecting another incremental column leads to the same thing since the remembered value cannot be compared to those of another column."
    Last edited: Feb 18, 2016
  11. Baracskai Attila

    Baracskai Attila Administrator

    Define source and target data table fields:

    upload_2016-2-18_11-37-46.png
    Last edited: Feb 18, 2016
  12. Baracskai Attila

    Baracskai Attila Administrator

    Structure of AVReporter table:

    upload_2016-2-18_11-33-30.png

    upload_2016-2-18_11-40-30.png
    Last edited: Feb 18, 2016
  13. Baracskai Attila

    Baracskai Attila Administrator

    AVReporter uses datatimeoffset. That's why first step it is necessary to convert local timestamp to type of datatimeoffset timesstamp.

    upload_2016-2-18_16-27-51.png
  14. Baracskai Attila

    Baracskai Attila Administrator

    Datetimeoffset conversion:

    upload_2016-2-18_21-6-54.png
  15. Baracskai Attila

    Baracskai Attila Administrator

    Save job and after that try CSV import:

    upload_2016-2-18_21-10-3.png
  16. Baracskai Attila

    Baracskai Attila Administrator

    Check result in BasicReporter:

    upload_2016-2-18_21-11-45.png

    Attached Files:

  17. Baracskai Attila

    Baracskai Attila Administrator

    Download job example

    Attached Files:

Share This Page