hi,
is there any function that we can check is .csv file is corrupted or not?
note:-.csv.file will receive from external system
suggest me best approch?
Discussion posts and replies are publicly visible
Does corrupted file mean a file that cannot be opened at all due to some malfunction or damage?
hiShubham Aware , yes if the file can't open due to password or someother reason's. then that time we should make a entry in db that file is corrupted. for that how we can handle?
I assume if a file is corrupt then any function or smart service trying to read data from it will not behave as expected. So you can try reading data from the file and log accordingly if its successful or not.
PM Exception Flow is your only native way to catch can't open scenarios.Receive File -> Try to Parse CSV -> if Success: Process Data ; if Exception: Write "CORRUPTED" to DB -> Notify Team.
hi Shubham Aware , thanks for quick response, kindly confirm is this (Parse CSV) plug-in?
A CSV file is just text. So technically it cannot be corrupt or encrypted. But it might happen that it does not follow the expected schema. You could try to read the first line and check the column names against your expectations.
If you're getting "bad" CSV files, open one in Notepad++ and see what text it contains, and check to see if the 'bad' version is consistently the same.
If it's consistent, then use the "read text from file" utility to do an initial reading of the CSV file and scan for some of the text you'd expect to (only) see in the 'bad' file. If so, route elsewhere. If not, attempt to read it using your in-process reader of choice. (Note: this requires you to do the reading via a process model, but I'd recommend you do that in any case).
You can use any available plugin to parse CSV which is available on app market.You can refer thishttps://community.appian.com/b/appmarket/posts/excel-tools
Hi Shubham Aware ,
we have requirement like,
Try the function previewcsvforimport() available in Excel Tools plugin to read the csv file