Data Table arrangement alphabetically

So I used the Sort Data Table activity to sort my data and below is the Output but I realized that the sorting was done alright but not as I wanted it to do the sorting. How do I move the second VIM to the bottom to be aligned with the Vffood and the last Vim? Please assist

[Host name,CPU Util (Used %)1,Mem Util (Used %)1,FS: /var Util1
vfghcn-jira-app-vml1p - 20.234.225.90,0.12 %,12.80 %,31.94 %
vfghcn-vim-vml1p - 20.234.225.99,0.52 %,8.77 %,3.49 %
vfghgb-jira-app-vml1p - 20.234.225.97,13.08 %,70.88 %,79.40 %
vfghgb-jira-db-vml1p - 20.234.225.99,11.25 %,22.00 %,5.60 %
vfghgb-jira-lb-vml1p - 20.234.225.88,0.17 %,8.53 %,9.17 %
vfghgb-rms-app1-vml1p - 20.234.225.95,0.64 %,17.64 %,15.81 %
vfghgb-simregapp-vml1p - 20.234.225.70,8.02 %,81.05 %,10.16 %
vfghgb-simregapp-vml2p - 20.234.225.92,10.73 %,75.95 %,11.88 %
vfghgb-simregdb-l1p - 20.234.225.60,3.00 %,41.07 %,37.75 %
vfghgb-vffood-vml1p (ECSMS) - 20.234.225.10,9.23 %,17.63 %,41.58 %
vfghgb-vim-vml1p - 20.234.225.991,0.89 %,10.06 %,3.04 %
]

@Baba_Karim_Abdulai
Please help me to understand your query. You want to sort the table by Host Name, without considering the IP address.

@Baba_Karim_Abdulai
Try sorting the “Host name” column in descending order.

Use LINQ expression, “dt.AsEnumerable().OrderBy(Function(row) Text.RegularExpressions.Regex.Replace(row(“Host name”).ToString,”\b\d{1,3}(?:.\d{1,3}){3}\b",“”).ToString).CopyToDataTable()" , Here dt is your datatable variable , we are sorting with Host name column by removing ip address using regex.

Hello @Baba_Karim_Abdulai
try below

dt_Input = dt_Input.AsEnumerable.OrderBy(function(rw) rw("Host name").ToString.Split("-"c)(1)).CopyToDataTable

Just removing the IP address wont help with sorting. OP is facing issue with soring due to first set of char in host name i.e. vfghcn,vfghcn,vfghgb etc.

can string manipulation on Host name as needed.

that I agree, but seeing the post from OP, he is not that familiar with String manipulation hence created a post in forum.

@Baba_Karim_Abdulai

first you need top decide on what basis you need to sort

as the sort is done as per the letter in your host

if you need to change and use only part of string then go with linq sorting instead of sort datatable

cheers