![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks. |
| |||||||
![]() |
| |
| | #1 (permalink) |
| | Parse CSV file and display Column B in HTA ListBox I have a CSV file including headers (don't want them in my listbox) with several Columns which need I need to have parsed and displayed in an HTA. Column B is the the only column I would like the user to see in a dropdown listbox. The user will select from the listbox, then click a Submit Button. Once clicked I have a vbscript already made which will take various fields from the parsed data and create a second CSV file. Anyone know a simple way to achomplish this? Any change in my process to make this easier? I appreciate any comments or suggestions! |
My System Specs![]() |
| | #2 (permalink) |
| | Re: Parse CSV file and display Column B in HTA ListBox "Natron" <Natron@xxxxxx> wrote in message news:56A59099-C698-4A70-9E16-756961AC6CDB@xxxxxx Quote: > I have a CSV file including headers (don't want them in my listbox) with > several Columns which need I need to have parsed and displayed in an HTA. > Column B is the the only column I would like the user to see in a dropdown > listbox. The user will select from the listbox, then click a Submit > Button. > Once clicked I have a vbscript already made which will take various fields > from the parsed data and create a second CSV file. Anyone know a simple > way > to achomplish this? Any change in my process to make this easier? I > appreciate any comments or suggestions! Opening and reading the file => FileSystemObject, OpenAsTextStream Finding column B => Use Split function with comma Creating the list options => Use documentGetElementById on the select then create a new Option(text, value) and add it to the select.options collection using add method -- Joe Fawcett (MVP - XML) http://joe.fawcett.name |
My System Specs![]() |
| | #3 (permalink) |
| | Re: Parse CSV file and display Column B in HTA ListBox "Natron" <Natron@xxxxxx> wrote in message news:56A59099-C698-4A70-9E16-756961AC6CDB@xxxxxx Quote: >I have a CSV file including headers (don't want them in my listbox) with > several Columns which need I need to have parsed and displayed in an HTA. > Column B is the the only column I would like the user to see in a dropdown > listbox. The user will select from the listbox, then click a Submit > Button. > Once clicked I have a vbscript already made which will take various fields > from the parsed data and create a second CSV file. Anyone know a simple > way > to achomplish this? Any change in my process to make this easier? I > appreciate any comments or suggestions! the CSV file contain commas, then his suggestion to split on commas will fail to give you the correct results. Other solutions for this have been posted in the past. Use GROUPS.google.com, and enter the following: "example vbscript using the Microsoft Text Driver to open a CSV file " group:*.scripting.vbscript The above should be all one line. You should get about two results, with sample code to extract the fields two different ways. -Paul Randall |
My System Specs![]() |
| | #4 (permalink) |
| | Re: Parse CSV file and display Column B in HTA ListBox Joe, I appreciate the comments and suggestions for solving my issues. I was looking for a place to start and was not finding many examples on the web. (must be looking in the wrong places!) I will be trying your suggestions and will post back with my results for all to learn from. Thanks again for the speedy reply! "Joe Fawcett" wrote: Quote: > "Natron" <Natron@xxxxxx> wrote in message > news:56A59099-C698-4A70-9E16-756961AC6CDB@xxxxxx Quote: > > I have a CSV file including headers (don't want them in my listbox) with > > several Columns which need I need to have parsed and displayed in an HTA. > > Column B is the the only column I would like the user to see in a dropdown > > listbox. The user will select from the listbox, then click a Submit > > Button. > > Once clicked I have a vbscript already made which will take various fields > > from the parsed data and create a second CSV file. Anyone know a simple > > way > > to achomplish this? Any change in my process to make this easier? I > > appreciate any comments or suggestions! > Which part are you struggling with? > Opening and reading the file => FileSystemObject, OpenAsTextStream > Finding column B => Use Split function with comma > Creating the list options => Use documentGetElementById on the select then > create a new Option(text, value) and add it to the select.options collection > using add method > > > -- > > Joe Fawcett (MVP - XML) > http://joe.fawcett.name > > |
My System Specs![]() |
| | #5 (permalink) |
| | Re: Parse CSV file and display Column B in HTA ListBox Nice Search String Paul, thanks for the additional comments....I should have this wrapped up later this week and will post back for any more suggestions on the overall HTA. Thanks for the quick reply! "Paul Randall" wrote: Quote: > > "Natron" <Natron@xxxxxx> wrote in message > news:56A59099-C698-4A70-9E16-756961AC6CDB@xxxxxx Quote: > >I have a CSV file including headers (don't want them in my listbox) with > > several Columns which need I need to have parsed and displayed in an HTA. > > Column B is the the only column I would like the user to see in a dropdown > > listbox. The user will select from the listbox, then click a Submit > > Button. > > Once clicked I have a vbscript already made which will take various fields > > from the parsed data and create a second CSV file. Anyone know a simple > > way > > to achomplish this? Any change in my process to make this easier? I > > appreciate any comments or suggestions! > Most of Joe Fawcett's suggestions are 100% correct. If individual fields of > the CSV file contain commas, then his suggestion to split on commas will > fail to give you the correct results. Other solutions for this have been > posted in the past. Use GROUPS.google.com, and enter the following: > > "example vbscript using the Microsoft Text Driver to open a CSV file " > group:*.scripting.vbscript > > The above should be all one line. > You should get about two results, with sample code to extract the fields two > different ways. > > -Paul Randall > > > |
My System Specs![]() |
![]() |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Forum | |||
| reading the first column from a file | PowerShell | |||
| Naming a text file from a selection in a listbox | VB Script | |||
| Windows Explorer: Display File Size Column In Bytes? | Vista file management | |||
| Where Is File Size Column on Search Screen? | Vista General | |||
| file size column heading in search | Vista General | |||