I am trying to do 2 things:
I have a text file (Books.txt) and I am trying to create an application to display fiction and nonfiction books (separately) within a ListBox. The text file reads this:
Left Behind,Lahaye,F,7,11.25
A Tale of Two Cities,Dickens,F,100,8.24
Hang a Thousand Trees with Ribbons,Rinaldi,F,30,16.79
Saffy's Angel,McKay,F,20,8.22
Each Little Bird that Sings,Wiles,F,10,7.70
Abiding in Christ,Murray,N,3,12.20
Bible Prophecy,Lahaye and Hindson,N,5,14.95
Captivating,Eldredge,N,12,16
Growing Deep in the Christian Life,Swindoll,N,11,19.95
Prayers that Heal the Heart,Virkler,N,4,12.00
Grow in Grace,Ferguson,N,3,11.95
The Good and Beautiful God,Smith,N,7,11.75
Victory Over the Darkness,Anderson,N,12,16
The third-to-last element either says F for fiction or N for nonfiction. I am trying to write a code to where the application looks into the text file, checks to see if element 3 is either an F or an N, and posts only the title of the book (the first element) in the ListBox.
My ListBox is named lstInventory.
You’ll want to split each line by
,into an array. From there, it’s easy: