Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in Toronto Sept 9th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Ghosh612
Contributor
Contributor

Text to Metadata in csv delimited format, but there is a comma in the data.

Hello all,

There is this issue i am facing,

  1. Master Data is in a text file,
  2. I'm creating a Metadata in csv delimited
  3. the text file has data like

Category_ID,Category_Name

CAT07,Pens & Art Supplies

CAT08,Scissors, Rulers and Trimmers

The problem is that the 2nd line of data has a comma in the data itself, co it creates a Column 2 for Rulers and Trimmers.

How to create the metadata with only 2 columns?

Thank you for your input.

Labels (2)
1 Solution

Accepted Solutions
gjeremy1617088143

on other side if category id are always with the same patern, you can replace the comma after it with an other separator like ; or § easily. you can use replaceAll("(?<=CAT\\d{0,10}),",";")

to transform all the comma preceded by CAT + 0 to 10 digits into ";".

View solution in original post

3 Replies
gjeremy1617088143

Hi, if comma in your data itself have a space after you can replace them easily, cause you can differentiate them with comma separator wich seem to have no space after. Else you have to clean data before send it in the job.

Send me Love and Kudos

gjeremy1617088143

on other side if category id are always with the same patern, you can replace the comma after it with an other separator like ; or § easily. you can use replaceAll("(?<=CAT\\d{0,10}),",";")

to transform all the comma preceded by CAT + 0 to 10 digits into ";".

Ghosh612
Contributor
Contributor
Author

These are the settings I am using to create metadata out of a txt file.

 

The output as usual seems to be like this:

The rulers and trimmers needs to be in the previous column. The data has a , followed by a space. I am trying to address that, but I'm failing to generate an output.

 

The above is just one of the scenarios. I have tried multiple ways to put the separators.

 

Thank you for your response 🙂