Skip to content
Advertisement

Get filename while reading csv

I want to read values from csv files, and order them in a table (console output).

How can I output all files in a folder and read all content in this files, and get filename while reading files with the content in it? I have so far only this, but I can’t become the filename in right way, I become only the last filename and not the content of this file.

JavaScript

This is what I become (I get only that filename, which is at the end of the folder).

JavaScript

but I need all filenames in this folder with corresponding content and save these in subfolder with filename and datetime with time when this was read, like:

JavaScript

Can you please give me some suggestions in which way to go?

Advertisement

Answer

If I understand your question, you need to first build a List of files and then iterate it –

JavaScript
User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement