I have the attached result in ListView and would like to separate the words by commas to make them readable. Can code be added to do this and if so where? Thanks for any help.
Attachment 88777
Printable View
I have the attached result in ListView and would like to separate the words by commas to make them readable. Can code be added to do this and if so where? Thanks for any help.
Attachment 88777
What commas?
you could use regex.
do you have a list of the unique (distinct) words that each listviewitem might contain?
also... that looks more like a listbox than a listview
Attachment 88779
It is listview. The words can be any or all of those in the attachment.
Looks like a separation at each Capitol Letter with the exception of Sci-Fi, hence leaving words that have hyphens alone - and treated as one word.
And there is also "Science Fiction" making things even more complicated. Before entering on how to create an AI that splits your words back, may I ask.. why are you adding them concatenated like that to the LV?
can you post your code? there's got to be a simpler way, before you add the items to the listview
Here is the code:
Attachment 88781
Can you attach the movie.xml file this program of yours operates with?
Sample movie.xml attached
Attachment 88783
try this:
vb Code:
Dim lvi As New ListViewItem(xml.SelectSingleNode("Title/LocalTitle").InnerText) lvi.SubItems.Add(String.Join(", ", Array.ConvertAll(xml.SelectNodes("Title/Genres/Genre").Cast(Of XmlNode).ToArray, Function(n) n.InnerText)))
the problem is that you're saving your listview contents as excel CSV + the delimiter in a csv file is a comma.
therefore excel sees that 1 field as several. use a semi colon ; instead of a comma:
vb Code:
Dim lvi As New ListViewItem(xml.SelectSingleNode("Title/LocalTitle").InnerText) lvi.SubItems.Add(String.Join("; ", Array.ConvertAll(xml.SelectNodes("Title/Genres/Genre").Cast(Of XmlNode).ToArray, Function(n) n.InnerText)))
rate Paul OP and mark this thread as Resolved, please.
TY
Well, Sir .Paul has an absolutely brilliant future of Rep points [2000+] -wow..
I am sure you did it right, even though [RESOLVED] does not appear in Thread title.
We will overlook this minor discrepancy...
for now.
mauahhahahaha
;)
good Luck OP!
What is the correct way to mark Resolved?
at the top right of your original question, there's a Thread Tools menu, which contains a Mark Thread Resolved menuitem