Convert comma seperated text to a dictionary

i am having a textfile which contains key values with comma seperated. how can i convert it into dictionary without using generate datatable activity.

example data in text file –

Process Related,
Initialization Email List,

I need to read this text file and convert it into dictionary

Hi @Sree_Krishnan_vellinezhi

May I know the expected output.

DIctionary need to assign as key value pair

for example

keys-- logF_BusinessProcessName,Processrelated,Botname,CaseLimit,Initializationmaillist

In your example text there is no equal pairs of key and value. Check once @Sree_Krishnan_vellinezhi

yeah some keys are having blank values , that we have to ignore

looks like CSV data

so we can do:

  • Read CSV Activity - out: dtData

Assign Activity:
dictData | Dictionary(OF String, String) =
dtData.AsEnumerable.ToDictionary(Function (x) x(0).toString, Function (x) x(1).toString)


Give me the pairs properly @Sree_Krishnan_vellinezhi

@ppr any way to avoid Datatable ?
this one i have already done

leave it bro u cant … thanks for your response


Even we can use generate datatable using comma seperation and convert it but am trying to convert it without datatable involvement.

You said it is text and you provided input is wrong. There is no spaces between some of the commas. How can I validate in which place there is spaces. @Sree_Krishnan_vellinezhi

how u r reading a text file using read csv activity ??? this comes in a text file


Can we avoid duplicates in the linq ?


Just redefine in detail and at complete base the use case along with representative sample data.
We will have a look at the revised description

You mean i need to try the latest query ?

See here @Sree_Krishnan_vellinezhi

If your input as below

Process Related,,
Initialization Email List,,

Then here is the output,

If you don’t know how to do it check the below workflow,

2024.xaml (19.3 KB)

Hope you understand!!

how this will work for dictionary of string,object