Updating an existing csv

Use this board for starting discussions, asking questions, and giving advice on Web programming for the IBM i platform (and predecessors.)
amarschner@masters
New User
Posts: 13
Joined: Wed Jun 15, 2016 12:48 pm
First Name: Al
Last Name: Marschner
Company Name: Masters Gallery Foods, Inc.
Phone: 920-893-9100 x670
Address 1: 411 Cty Hwy PP
City: Plymouth
State / Province: Wisconsin
Zip / Postal Code: 53073
Country: United States
Contact:

Updating an existing csv

Post by amarschner@masters »

Each time an export is performed, a new speadsheet is created. Is there a way to update/add to an existing spreadsheet.
Users need to create 1 spreadhseet from multiple exports.
Al Marschner
Masters Gallery Foods, Inc.
Scott Klement
Experienced User
Posts: 2711
Joined: Wed Aug 01, 2012 8:58 am
First Name: Scott
Last Name: Klement
Company Name: Profound Logic
City: Milwaukee
State / Province: Wisconsin

Re: Updating an existing csv

Post by Scott Klement »

When an export is performed a CSV file (which isn't technically a spreadsheet) is exported from the grid. The user is asked to download/save it to their PC.

You ask about modifying an existing sheet. Are you asking for it to do this?

1) Ask the user to upload a CSV file
2) Load that CSV file into a grid
3) Allow your code to modify the grid
4) Export the grid again to create a new CSV file

Is that what you're asking? If so, it can be done by using the File Upload widget to upload the CSV, and then you can write code (we don't do this automatically, sorry) that will read the CSV file and load it into your subfile. From there you can modify the subfile and export it again.

Remember, this tool is entirely a feature of the grid/subfile widget. So if you're looking for a tool that will allow modification of a spreadsheet (vs. exporting our subfile grid) then you are looking in ths wrong place, that is not what our tools are for.

Instead, you could cosnider using POI, which is a general tool for working with Office documents. It doesn't understand CSV format, but it does understand Excel's native XLS and XLSX formats. (Which are better, anyway.) I've written about these tools, you can find information here:
http://www.scottklement.com/poi/
TaskForce_Kerim
New User
Posts: 16
Joined: Mon Jul 02, 2018 7:56 am
First Name: Kerim
Last Name: Güney
Company Name: Task Force IT-Consulting GmbH
City: Dortmund
Zip / Postal Code: 44369
Country: Germany
Contact:

Re: Updating an existing csv

Post by TaskForce_Kerim »

If I understand Al correctly, they want to actually append a spreadsheet to another spreadsheet that exists on the user's file system, i.e. merging multiple CSV files.

That is not possible.

Scott's suggestion is a possible workaround. Or you could try a simple online tool like this one: http://merge-csv.com/

Your users generate multiple CSV files and then merge them with the aforementioned tool.
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests