Skip to main content
hemantb0002
Known Participant
Oct 6, 2023 2:54 PM UTC
Question

How Import CSV file and load into CDT(without database)

I want to parse CSV file and load into CDT without DB. Please suggest a plugin which is not deprecated.

5 replies

mikes0011
Brainy
Oct 6, 2023 6:17 PM UTC

The Excel Tools plug-in contains a function, "previewCSVForImport()", which should allow you to read CSV contents into local data and parse as you will.

The Expression Guru
hemantb0002
Known Participant
Oct 11, 2023 9:31 AM UTC

Thanks [mention:b45a4f6a20b14a008e4e0ec732a8bf98:e9ed411860ed4f2ba0265705b8793d05], But this has limitation to parse only 1000 rows. I want to parse around 2500 records.

mikes0011
Brainy
Oct 11, 2023 12:14 PM UTC

This sort of detail needs to be mentioned up-front then.

I want to parse around 2500 records.

The only alternative I can think to suggest is that you convert your CSV into an Excel file, and then use the "readExcelSheetPaging()" function, and read paged sets.

The Expression Guru
mathieud0001
Genius
Oct 11, 2023 12:36 PM UTC

You could try using https://community.appian.com/b/appmarket/posts/text-file-reader. Basically load the csv file, split it into an array based on carriage return.

a!localVariables(
  local!items: split(
    readtextfromfile(cons!S_CSV_DOCUMENT, true),
    char(10)
  ),
  a!forEach(
    items: local!items,
    expression: split(fv!item, ",")
  )
)

mikes0011
Brainy
Oct 11, 2023 12:37 PM UTC
Basically load the csv file, split it into an array based on carriage return.

And pray none of the data columns contain escaped commas... (though the parse CSV row function might help with this, otherwise it'll be a nightmare)

The Expression Guru