Hello,
I have a CSV file as such
User, Number, Notes
Test, 1, Office on 2nd Floor.
Can I type text into a richtextbox and have it formatted and saved to a CSV?
Save RTB text to specific CSV cell
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: Save RTB text to specific CSV cell
Here is a starter demo:
- Attachments
-
- Demo-DGVExport.psf
- (18.97 KiB) Downloaded 86 times
Re: Save RTB text to specific CSV cell
I see how it can load and edit the CSV directly.
How do I use the export button for a specific cell? In the ISE, I can do something like this
$NewNotes = 'This is an appended note'
(Import-Csv $CSV | Where-Object {$_.samaccountname -eq 'jones'}).notes |foreach{{$_.Notes = + $NewNotes}}
Using the form as is, it produces a new line
How do I use the export button for a specific cell? In the ISE, I can do something like this
$NewNotes = 'This is an appended note'
(Import-Csv $CSV | Where-Object {$_.samaccountname -eq 'jones'}).notes |foreach{{$_.Notes = + $NewNotes}}
Using the form as is, it produces a new line
Re: Save RTB text to specific CSV cell
It is impossible to understand wha5t you are asking. You cannot export one cell to a whole CSV. You can export a collection of rows with one or more cells to a CSV.
Your description and question do not have enough or correct informatiuon to tell us what your issue is.
Your description and question do not have enough or correct informatiuon to tell us what your issue is.
Re: Save RTB text to specific CSV cell
Remember from earlier, I'm trying to build a Notes section which is just a new column in the CSV
So within my app, I'm only displaying ONE cell, which is the notes cell
This will display the notes cell. I want to add new notes into the cell, so what code do I put in the $buttonExportCsv_Click block to update the CSV
So within my app, I'm only displaying ONE cell, which is the notes cell
- $Notes = Import-Csv 'C:\Users.csv' | Where-Object {$_.Shortname -eq 'jones'} | Select-Object Notes
- $datagridview1.DataSource = ConvertTo-DataTable $Notes
Re: Save RTB text to specific CSV cell
You have to load teh whole CSVinto the DGV, edit the specific cell and save the whole CSV.
Second option. Load teh CSV, find the cell, display, edit it, update teh CSV, save the whole CSV.
Third option: loaqd teh CSV as a Data object, edit cell, update object which will update the cell in the CSV file.
Second option. Load teh CSV, find the cell, display, edit it, update teh CSV, save the whole CSV.
Third option: loaqd teh CSV as a Data object, edit cell, update object which will update the cell in the CSV file.
Re: Save RTB text to specific CSV cell
Correct
Number 2 is what I'm using - or should I say trying to
I can say if I create the CSV it works as expected, but if I import it, everything gets erased but the column name, and the notes. So my guess is that I'm finding it and displaying it incorrectly.
Number 2 is what I'm using - or should I say trying to
I can say if I create the CSV it works as expected, but if I import it, everything gets erased but the column name, and the notes. So my guess is that I'm finding it and displaying it incorrectly.