Add quotes around text in cells in Apple's Numbers

I do a bit of scripting every now and again for my position as Systems Administrator.  As a Mac user I prefer to use the Apple’s offerings for a lot of what I do.  As such, I was constructing a powershell array from a text file with a column of computers.  Numbers opened the text file with all the computer names in a nice neat column but I needed to add quotes and a comma to each cell to construct the array like so:
$compyarray=@(
“Compy1”,
“Compy2”,
“Compy3"
)
ForEach($name in $compyarray){
     Get-ADComputer $name
}

So, to get Numbers to add the quotes and comma for you, do the following:
1.) Select the column or cells that you want to format
2.) Show the inspector (right-hand formatting pallet) if it isn’t already visible
     A) View —> Inspector —> Show Inspector
3.) Choose “Cell” if it isn’t already selected
4.) From the “Data Format” drop-down select “Create Custom Format…."
5.) In the “Custom Format:” box add your quotes before and after the [text] block as well as the comma.
6.) Once you choose “OK” it will apply this change to all the selected cells or the selected column
7.) From there you can copy and paste into powershell and away you go!

Comments

Popular Posts