Using IBM i? Need to create Excel, CSV, HTML, JSON, PDF, SPOOL reports? Learn more about the fastest and least expensive tool for the job: SQL iQuery.
RPG xTools has always had CSV Generation APIs, but now I've built a CSV reader API for RPG. Question is, is this something lots of people need? I know I'm using CPYFRMIMPF all the time (coming from Excel) so the ability to read and parse the CSV file directly is very helpful to me.
Any comments?
That would be useful. Post it as your next RPG Report newsletter!
What I've got working is the parser itself.
RPG xTools has the "read IFS file" thing in it.
But right now, the parse accepts a "row" of data, parses it and returns the results to an array.
So each CSV value is stored in an individual array element which the programmer would then use EVAL along with %DEC or straight assignment to move the elements into the corresponding fields.
Like my Write To CSV API, I would probably include an API in xTools that provides an Open, read record, close thing.
Wish I had not lost track of you guys when the old system shut down, this post would have been very useful to me tonight.
I just had to spend a hour writing an import module for a CSV file. :) It wasn't tough of course, not with %SUBST and %SCAN. And wasn't generic either, it was for one single format - but it amazes me how much I forget if I am not using it each day. ;)
-Paul
I recently watched a video of Jon Paris, talking about rpg open access which contrary to the opinion of some, it is more than just for web enablement. He did examples of using OA to write csv files and so reading is also something and unlike passing the results back in an array, etc. one could get them loaded right into the fields.
anyone using OA to do webservices, read/write csv files, etc.?