deepakjain2020 wrote:
I have a raw file (A.CSV) and want to pull out with 12 values in a single record as output in a file (B.CSV)
A.csv file
Output file format (B.CSV)
looking to process this using TI Process.
Please share your ideas.
So basically you want to take something that doesn't so much qualify for the term "data file" as it does a "stream of consciousness narrative", and convert it into something structured and delimited.
Good luck with that. My first suggestion would be to return to whoever is supplying the data and ask them to read the introductory section of any given web page on "How to output text data".
Failing that,
IF you can discern any patterns at all in the source data, it would be possible for you to, for example:
(a) Declare a variable as an empty string in the Prolog;
(b) In the Data tab, keep reading each input record until you get a complete output record. For example if you know that the headings will have no more than n fields in them, and that each field will terminate with a semi-colon with subsequent commas being ignored, you could use that knowledge to read
A;B; from the first row and ignore the rest since there are no further semi-colons, read
C; from the second one (and so on) until you get to
L (which would need to be coded as a special case since it has no semi-colons at all). With each row you append the relevant part of the content to the string variable and then, once you have it all, use an Ascii output function to write it.
You could use a combination of the Scan() and SubSt() functions to do this. Naturally the code in question will be wrapped inside an If() block so that it only executes until you finish working out the header row.
If you know that after you get through creating the heading row, everything will be data, you could use the same functions to split out all of the values between semi-colons, again ignoring the commas that appear after the last semi-colon, and pad out the extra fields with as many semi-colons as you need. Again this block of code would be inside an If() block, and only executed on records which appear after the header row has been written.
That's of course only
IF you can make those kinds of predictions.