Inbound data using CSV to hit F41061

johndanter

johndanter

Legendary Poster
Hi folks,

I'm having a brain fart today sorry. I have been asked to help upload some 160000 records every so often into E1 using a CSV.

In the past I've coded Table Converters or pointed people to R47002C. But this time I need to be a bit smarter as I need to clear matching records off F41061 and do some validation before insert.
Also automated detection of the new CSV file would be welcome.
Is there something in E1 that allows screens to detect a drag and dropped file? I've seen Steltix Dropzone does this, but how? AIS? But what tech knows a file has been dropped

So with that in mind

1) What BSFNs read CSVs files? B4700240 jdeFopen is the API right? EDIT I've prototyped this Fetch Next Line from Flat File with .txt and csv file.

2) How can I get an APPL screen to detect someone has drag and dropped a file for upload? (as failing that it's the old fashioned route of get a UBE to point to a mapped folder)

3) can FetchNextLineFromFlatFile(B76B0220.FetchNextLineFromFlatFile) handle CSVs? EDIT ignore yes it can

4) Are there any BSFN s that can check a file is present in a folder if it doesn't know it's exact name? CheckforFile needs an exact name right?

Thanks

John
 
Last edited:
John,

Try B9600471, which contains FindFirstFileMatchingWildcard and FindNextFileMatchingWildcard functions. Call the FindFirst function to get a handle which can be used to get additional files with the FindNext function. Both return the file name, whether it's a file or a subdirectory, the file size, and the attribute flags Read-only, Archive, System, and Hidden.
 
Brilliant, thanks. Works like a charm :)

I looked in UBE R9640M to see how it's called, as I had tried this before but couldn't get it working. I wasn't using the wildcard bit correctly.

For anyone else reading this in the future, you start the processing by searching for the first file using FindFirstFileMatchingWildcard as such: C:\TEST\*.TXT. You get the first file name back. You can then look for more by calling FindNextFileMatchingWilcard
 
Back
Top