$newColumn1 = $column1)įor ($i = 0 $i -lt $newColumn1. $data.Stuff,$data.Stuff = $data.Stuff,$data.Stuff # get the first column as array of valuesġ If you have a text or comma-separated values (CSV) file that that you want to save as an Excel workbook, you can easily open the file in Excel. TXT, but is there a different way to "properly" do it without renaming the "copy-item and saving it as a txt" $data = Import-Csv -Path $csv -Header 'Stuff','City','Number','InStock' # or add whatever headers you like Reminder, my method does work and outputs a. You can select only one file to convert them one at a time or you can select all of them to perform easy batch TXT conversions. $txtfile = $date $lastname "-" $lastxxx "-" $lastnum "-" $lastxxxtwo "-" $lastloc "-" $newid ".txt"Ĭopy-Item "$csv" -Destination "$path$txtfile" Convert CSV to TXT Click on one of the Convert buttons, located in the bottom right-hand corner of the program or in the main toolbar. $pathdone = 'C:\Users\xxx\Desktop\xxx Playground\CSV Edit\done' $path = 'C:\Users\xxx\Desktop\xxx Playground\CSV Edit\' TXT $csv = 'C:\Users\xxx\Desktop\xxx Playground\CSV Edit\20190522-Name-Num-Location-hey-hey.csv' This is the current way I save the CSV as a. I was told that a rename from filename.csv to filename.txt isn't the correct way ( in my opinion it works ), but is there another way to save a CSV as a TXT file "properly" I have a powershell script that edits a CSV and saves it.
0 Comments
Leave a Reply. |