Manipulating CSV inside the form, or function in form
I need help or an idea for a functionality im trying to make.
i am trying to make a form that uploads a specific csv file, that file content needs to be manipulated before going in the database.
for example: i have a file with 7 lines, i need 3 of them to be combined to a single line and the other 4 to be as is.
what im trying to do is to upload the csv, and after the file upload input i want the csv to be processed and then based on the content show different fields to the user to appoint each "new row" as needed.
any idea how to do the csv proccess in the middle of the form?
6 Replies
Use the hooks available in the Importer Resource Class
i cant get the file before the submit, is there a way to upload it instantly and then work with it?
U can use beforFill hook
I got lost in my own code, and i dont think the importer function will work for me unless im using it incorrectly.
what i want is this:
i want to select a CSV file with game data and analytics.
i want the system to analyze the CSV file and process it (combining rows if needed, or using it as is)
then it will have a list of games and its data, i want it to create a row in one table with the user choosing the name of the player and such in a table called GameRecord
and the data from the csv, to insert it into a GameRecord_meta table based on key value structure.
i managed to process the csv file, the question is how do i create a section of form for each player
hope my explanation is understandable.
You can use the beforeSave hook of the Importer Resource to perform all sort of manipulation