Creating a .jpl file with various attributes

I need to create a .jpl file with the following example attributes:

zeich_nr = “hfghgjfj”
dokuart = “DDATB”
var_nr = “4654”
logi = “Fr”
feld[1] = “kiui”
feld[13] = “Sioi”
feld[50] = “19.08.2024”
feld[1] = “hieououon”
feld[1] = “ulopio”

The values for these attributes come from multiple sequences in the Project.
What would be the ideal way to create this file.

  1. Appending each line in a text file and then changing extension to .jpl OR
  2. Creating a data table with these attributes and then saving it as .jpl OR
  3. Any other easier approach?

Hi!

I probably would do it as a dictionary (Of String, String), then add key value pairs as I went.
Then write it to a .jpl file using the Write Text File activity (I think you can write directly to a .jpl-file by just having the extension in the Write to filename property, but you’ll figure it out :slight_smile: )

New Dictionary(of string, string) from {{“key1”,“value1”},{“key2”,“value2”}}
Something like this?

That’s it, then you can just update the dictionary as you generate the values you want to store

yourDictionary(“key”) = “1651651”

Or you could just add to your dictionary as you go using invoke method.

See this thread:
Adding items to a dictionary - Help - UiPath Community Forum

To get it to a string you can write to your text file just use a for each loop
How to loop through Dictionary? - Help - UiPath Community Forum

I get the error
"Assign: Expression Activity type ‘VisualBasicValue`1’ requires compilation in order to run. Please ensure that the workflow has been compiled. "

Hi @parnalmahavir.patni

Retype double quotes in the expression

Regards,

1 Like

As we have not unique keys
grafik
we cannot model it as a dictionary

but e.g. with datatable we can premodel, fill and generate the jpl file content e.g.

(keep in mind that the immediate panel escapes the inner ")
Screenshot file:
grafik

String.Join(Environment.NewLine, dtData.AsEnumerable.Select(Function (x) String.Format("{0} = ""{1}""", x(0), x(1) )))
2 Likes

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.