You can translate the question and the replies:

Tuple pattern for delimited file multiline

Hi Denodo Team, I have a delimited file with the below data format. In DVP, i would like to create a delimited file data source in tabular format. I have looked at the example given in the thread "Extract from Delimited File" from 2015 but could not get that to work for me. It is saying "There was an error while creating this base view: Column names could not be generated" when i try to replicate the example given in that thread. What should be the tuple pattern to be able to do the multiline searching and convert those "Project xxx" headers into columns? Ideally i would like it to look like as: Project Name Project ID Project Location ACME Project 1540_2018 New York Thank you "Project Name: ACME Project" "Project Id: 1540-2018" "Project Location: New York" "Project Cost Center: 2121" "Created By: emolas20"
user
28-03-2018 21:12:25 -0400

1 Answer

Hi, Typically, when dealing with multiline tuple patterns, I find that the "Column names could not be generated" error has more to do with the *End of line delimiter* than the tuple pattern itself. The error occurs when the parser can't differentiate between the end of a line *within* the tuple and the end of the tuple itself. If you're using the default \n to indicate the end of the line, then it's running in to that after each value in the record. There are two typical approaches, depending on your scenario, but they come down to one essential rule; the end of line delimiter must be *uniquely* the end of line delimiter and cannot appear within your tuple. For example, if your source file has an extra blank row - or if you have enough control over the system that generates it to create a blank row - then you can simply use *\n\n* as your end of line delimiter. If there's no way to make this distinction, then you'll need to consume part of your first column label with a delimiter like *\n"Project_N* - this means you'll need to manually rename the first column in your base view from *ame* to *Project_Name*, but it will allow you to parse the source file as expected. You may still need to adjust your tuple pattern to capture all the desired data, but the error is most likely due to lack of uniqueness on your end of line delimiter. Hope this helps!
Denodo Team
30-03-2018 19:58:15 -0400
You must sign in to add an answer. If you do not have an account, you can register here