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.
Appending each line in a text file and then changing extension to .jpl OR
Creating a data table with these attributes and then saving it as .jpl OR
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 )
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. "
lrtetala
(Lakshman Reddy)
August 20, 2024, 10:55am
6
Hi @parnalmahavir.patni
Retype double quotes in the expression
Regards,
1 Like
ppr
(Peter Preuss)
August 20, 2024, 11:23am
7
As we have not unique keys
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:
String.Join(Environment.NewLine, dtData.AsEnumerable.Select(Function (x) String.Format("{0} = ""{1}""", x(0), x(1) )))
2 Likes
system
(system)
Closed
August 23, 2024, 11:23am
8
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.