Skip to main content
1-Visitor
February 12, 2019
Question

CSV Parser

  • February 12, 2019
  • 1 reply
  • 1357 views

Can anyone suggest me, when there are multiple files in the repository(for ex: XYZ_01FEB,XYZ_02FEB something like this) and i'm using the CSV Parser Read File functionality,how can i make sure my service is reading each file. For example every 5 min the new file will get added to the repository.So how can i read each file here when the naming convention changes(timestamp gets appended to the file eachtime a new file gets placed).

?

1 reply

1-Visitor
February 12, 2019

You should leverage FileRepository methods in order to list files and act accordingly:

  1. ListFiles({ path: "" }
  2. Iterate over previous list files
  3. For instance once a file it's processed, remove or move to another folder with:
    1. DeleteFile({ path: "" })
    2. MoveFile({ sourcePath: "", overwrite: true/false, targetPath: "" })

 

1-Visitor
February 12, 2019

Hi !

 

I did not get this.

2. Iterate over previous list files

Could you please explain me this still more.May be with some example code. Since the file names are different i'm not able to do this.