Skip to main content
vicentg0001
New Participant
July 14, 2022
Question

Read the first line of a CSV

Does anyone know how to read the first line of a CSV?

I have tried the readcsvlogpaging() function but it only works for files that are in the logs directory, and the readexcelsheetpaging() function does not work for CSV documents.

Any ideas?

Thanks!

7 replies

mikes0011
Brainy
July 14, 2022

A CSV file is really just text (just in a particular format).  I think you might be able to leverage a rule that reads the contents of a text file - i'll look around and see if I remember the one I was thinking of.

The Expression Guru
vicentg0001
New Participant
July 14, 2022

I have also tried the readtextfromfile() function but the file is very large and I get the following error: The Memory Circuit Breaker prevented this evaluation from completing due to insufficient resources. Is there any way to limit this reading?

mikes0011
Brainy
July 14, 2022

Oof -- How large is the CSV?  Where is it coming from, and do you have any alternatives?

The Expression Guru
abhayd3663
Brainy
March 27, 2023

I am not aware of any way to read csv directly within the Appian. It has to be loaded into DB first and then retrieve from the same.

dhananjayk3480
Inspiring
October 6, 2026

If your environment has the popular [Excel Tools Plug-in](0.6.4, 0.6.7) installed, use the previewcsvforimport() function. Setting the numberOfRows parameter to 1 limits the parsing strictly to the first row (typically the header or first data row) without wasting memory on the rest of the file.