Select Distinct and then if found make some adding to the distinct file


#1

Hi guys,

So first i need to select distinct some of my files. After that i need to add something like (.) in the last of the data.
For example
000000-005133-20171229-004792
000000-005133-20171229-004792
000000-005133-20171229-004792
000000-005133-20171229-004792
I have this set value and after i get the data using select distinct next i want to edit.
Like this
000000-005133-20171229-004792
000000-005133-20171229-004792.
000000-005133-20171229-004792.
000000-005133-20171229-004792.

At the end of the data need to adds (.).

Is there any way to automate this?

Thanks

Best Regards

Delf


#2

Save your query results in a text file. Read text file and split by following Environment.NewLine condition.
Please use Split(entirePDF,Environment.NewLine)
this will give each line in an array(0) = “000000-005133-20171229-004792” + (.)
just append each array value with “.” and assign to a global variable in each iteration.

Hope my inputs are useful.


#3

Hi @rkelchuri,

Still configuring what you mean but thanks for the reply.

Still confused bout using split . also about assign to global variable?

can you give me an example if its possible?

Thanks


#4

Hi @delf,

create one String[] ->array of string variable (arrValue)

arrValue = entirePDF.Split(Environment.NewLine.ToArray, StringSplitOptions.RemoveEmptyEntries)


#5

Hi @delf,
Try this one
use assign activity
To->myString
Value->myString.Replace(System.Environment.NewLine, "."+System.Environment.NewLine)

Regards,
Arivu


#6

Just to clarify - dots at the end should be added only to duplicates (skipping first occurrence) or to all?


#7

Hi @andrzej.kniola

Yes, it will be skipping first occurrence and adding dots at the end only for the duplicates ones.

Thanks


#8

and also the result would be like this

Like this
000000-005133-20171229-004792
000000-005133-20171229-004792.
000000-005133-20171229-004792…
000000-005133-20171229-004792…

I dont know if i can do this. First im read the data using read range. after that using assign to select distinct file. After i get the distinct file what should i do?
im try using solution from @arivu96 but still with no avail results…

Thanks


#9

So the your input is datatable???

Regards,
Arivu


#10

Yes. My input is datatable

Thanks


#11

Ok I thought your input is string.

Use for each row activity Loop through it
Inside use assign activity
Row("columnname")=Row("columnname"). ToString()+"."

Regards,
Arivu


#12

Hi @arivu96

thanks for the reply,

still got an error. btw the syntax you gave to me will add (.) at the distinct data? or all the data in the datatable will be adds with (.)?

Thanks4


#13

What exception are you getting??? @delf