Export Multiple Textboxes to CSV
Forum rules
Do not post any licensing information in this forum.
Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
Do not post any licensing information in this forum.
Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
Re: Export Multiple Textboxes to CSV
It worked exactly as I wanted it to. I'll look into the differences this weekend.
Thanks
So how would you have worded my question so this doesn't happen again?
Thanks
So how would you have worded my question so this doesn't happen again?
Re: Export Multiple Textboxes to CSV
I cannot help with the wording as it was mostly because you lacked the PS skills that would have helped you to describe the issue the first time. Note that all early examples you posted failed to isolate accurately what you were trying to do. You would be able to ask a better question if you leaned basic PowerShell beyond just typing commands.
While your loop will work it is still better and faster to use the pipeline.
You will find this use of the pipeline more efficient and much more useful in the future,
While your loop will work it is still better and faster to use the pipeline.
- $assets |
- ForEach-Object{
- [PSCustomObject]@{
- Date = [datetime]::Now
- Tech = $textbox1.Text
- BadgeNumber = $textbox2.Text
- Asset = $_
- LastScan = $textbox3.text
- }
- }|
- Export-Csv $csvfile -NoTypeInformation -Append
Re: Export Multiple Textboxes to CSV
I'll be quick and say that was a jerk comment. Instead of answering the question you chose to assume I don't know basic commands.
I explained it several different ways and provided two different examples yet I'm the one lacking skills. You need a long look in the mirror.
I explained it several different ways and provided two different examples yet I'm the one lacking skills. You need a long look in the mirror.
Re: Export Multiple Textboxes to CSV
I am not saying you didn't try however, your explanation always pointed at an ambiguity that I couldn't resolve. You didn't say you wanted to enumerate a set of textboxes and output each one to a line in a CSV. The words you used, in retrospect, meant that to you but not to me. After you posted the last example I started to understand what you were trying to ask but had to make two guesses to get what you wanted.
Remember. I do not have your system and I do not know what you are seeing as an end result. You have to make this clear. Your first examples only further confused the request which is why I posted that you cannot get items from the parent form. Once you added the correct items to the form the guess was closer but it took an example of how you wanted the records to look before I understood that you wanted to enumerate certain textboxes and generate one record for each.
If you were better skilled in coding and PowerShell you would have known this up front. Windows Forms skills would have told you that the parent forms controls are no available in a child form.
I am not criticizing you, I am suggesting that a more technical study of programming, PowerShell and forms would help you understand how to design and code better.
Well - you have the answer so I guess you are set for now. Good luck and have fun.
Remember. I do not have your system and I do not know what you are seeing as an end result. You have to make this clear. Your first examples only further confused the request which is why I posted that you cannot get items from the parent form. Once you added the correct items to the form the guess was closer but it took an example of how you wanted the records to look before I understood that you wanted to enumerate certain textboxes and generate one record for each.
If you were better skilled in coding and PowerShell you would have known this up front. Windows Forms skills would have told you that the parent forms controls are no available in a child form.
I am not criticizing you, I am suggesting that a more technical study of programming, PowerShell and forms would help you understand how to design and code better.
Well - you have the answer so I guess you are set for now. Good luck and have fun.
Re: Export Multiple Textboxes to CSV
Remember earlier when I asked "how would you have worded the question?"?
You want to numerate a set of textboxes and output each one to a line in a CSV.
You want to numerate a set of textboxes and output each one to a line in a CSV.
Re: Export Multiple Textboxes to CSV
localpct wrote:Remember earlier when I asked "how would you have worded the question?"?
You want to numerate a set of textboxes and output each one to a line in a CSV.
?????
Re: Export Multiple Textboxes to CSV
Typo. Should be enumerate.localpct wrote:Remember earlier when I asked "how would you have worded the question?"?
You want to numerate a set of textboxes and output each one to a line in a CSV.