-
Feb 10th, 2013, 04:55 AM
#1
Thread Starter
Junior Member
[RESOLVED] listview export
i know i am being stupid here so i apologies before we start!
Trying to export a list view to a csv but i need it to export in an order, how do i change the count to run 5, 2, 3, 4??
Code:
For i As Integer = 0 To lv.Items.Count - 1
For j As Integer = 0 To lv.Columns.Count - 1
os.Write("""" & lv.Items(i).SubItems(j).Text.Replace("""", """""")+ """,")
Next
os.WriteLine()
Next
os.Close()
-
Feb 10th, 2013, 05:25 AM
#2
Re: listview export
Code:
Dim columnIndexes As Integer() = New Integer() {5, 2, 3, 4}
For Each columnIndex In columnIndexes
-
Feb 10th, 2013, 06:06 AM
#3
Thread Starter
Junior Member
Re: listview export
Originally Posted by jmcilhinney
Code:
Dim columnIndexes As Integer() = New Integer() {5, 2, 3, 4}
For Each columnIndex In columnIndexes
sorry i'm being idiotic here!
how would i use that? could you show me an example?
-
Feb 10th, 2013, 06:15 AM
#4
Re: listview export
It's a loop that provides you with column indexes. You already know what to do with such a loop because you've already got one in your code. The difference is that this one gives you the values you want in the order you want them instead of all the values in ascending order.
-
Feb 10th, 2013, 06:53 AM
#5
Thread Starter
Junior Member
Re: listview export
Originally Posted by jmcilhinney
It's a loop that provides you with column indexes. You already know what to do with such a loop because you've already got one in your code. The difference is that this one gives you the values you want in the order you want them instead of all the values in ascending order.
Yes i presumed that and but the column index is not a value of the listview or of the outfile?
so For Each columnIndex gives me an error on its own?
-
Feb 10th, 2013, 11:01 AM
#6
Thread Starter
Junior Member
Re: listview export
nevermind i got it in the end!
thanks
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|