I am trying to take text strings that include a category and one or more numerical values. I have encountered difficulties and am reminded of the joke - “How do you eat an elephant? One bite at a time.”
To provide context, I created the scenario where I have a 3-D printing business and get requests to make 1-D, 2-D, or 3-D objects. Examples would be CIRCLE, DISK, CYLINDER, or SQUARE, TILE, CUBE. Each object would have 1 to 3 numbers associated with it, sufficient to describe the object.
In order to provide the cost, I need to calculate how much material each object requires. Thus I would need to calculate the linear length, area, or volume depending on which object I am making.
A sample data file follows the format: quantity, shape, date required, and 1-3 values delimited with ‘/’. I have no control over the initial format.
5 CIRCLE 10 APR 24 5
20 SQUARE 5 APR 24 2.5
1 RECTANGLE 1 JUL 24 10/15
1 CUBOID 1 JUL 24 10/12.5/18
1 ISOSCELES TRIANGLE 1 JUL 24 4/5/15
The first problem is to parse the data. I had the idea of using the ‘text to columns’ feature in Calc but using the space as delimiter does not work with the multi-word object and the date. One solution is to edit the data to strategically insert commas.
5, CIRCLE, 10 APR 24, 5
20, SQUARE, 5 APR 24, 2.5
1, RECTANGLE, 1 JUL 24, 10/15
1, CUBOID, 8 JUL 24, 10/12.5/18
1, ISOSCELES TRIANGLE, 14 MAR 24, 4/5/15
This edited data will properly expand using “text-to-columns.” I can then calculate new columns (Linear, Area, Volume) using a switch statement referencing the shape column.
At the moment I have a multi-step process with manual editing, some automation, and copy/paste into another spreadsheet or sheet tab for my record.
I am looking for ideas on how to streamline the process. For example, using FIND or REGEX expressions to add the commas and perhaps even bypass the 'text-to-columns" step. This idea has it’s own learning curve and I am not sure if this path would be a huge improvement.
Right now, it is almost easier to type in the data. I would appreciate any ideas on how I can proceed. Besides improving my data entry skills.