I have a folder called Reports with several UTF-8 text files. Each file follows the next rule name:
userCode + '.txt'
I want to have a table with the next columns:
user_code | report
---------------------------------------------------
some user code | content of userCode.txt
For example:
user_code | report
---------------------------------------------------
D3677234 | 'Born in blah blah ...... '
D4535535 | 'Traveled to blah blah ... '
....
where the content of D3677234.txt is ‘Born in blah blah …… ‘
and the content of D4535535.txt is ‘Traveled to blah blah … ‘
So, I need a way to upload the content of those files into my table in Postgres directly from the Reports folder.
Any suggestions?
Thanks