Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Read Specific Record from txt file

Hi All,
My source is a Delimited file. I have around 1000 records. First record contains only date to identify that file is today's file. How can I read the first line alone for validation? And also assist on how to read a specific record from a file( for example 10th record,100 th record etc,.) .

Kindly assist.
Thanks,
Saty.
Labels (2)
4 Replies
Anonymous
Not applicable
Author

Hi
To read the first N line, you can set the Limit field on tFileInputDelimited to let the component only read the first N line, for example, set Limit as 1 to read the first line. To read a range of lines, for example, from 10th line to 20th line, you can use tSampleRow component.
Shong
Anonymous
Not applicable
Author

To read the first N line, you can set the Limit field on tFileInputDelimited to let the component only read the first N line, for example, set Limit as 1 to read the first line. To read a range of lines, for example, from 10th line to 20th line, you can use tSampleRow component.

Thanks Shong. I have one doubt. I have N no. of records in a text file. How can I select last record from the this file?
Kindly assist.
Anonymous
Not applicable
Author

I have N no. of records in a text file. How can I select last record from the this file?

Hi All,
Kindly someone assist on this.
alevy
Specialist
Specialist

The best way is probably to use tFileRowCount to get the number of records and then pass that as a variable to tFileInputDelimited's Header field (-1).