This article involves some Excel operations, the effect is simple
Steps:
-
Get the Docker version and generate a CSV file
-
Import CSV into Excel and simply clean the data
-
Use Excel PivotTable function to do simple counting statistics
-
Final result 🎉
Get the Docker version and generate a CSV file
We use the PSSH tool to get information in bulk
Here I will directly post the command:
pssh -i -l root -h ip_list -o docker-version-result "docker -v"
cat docker-version-result/* > docker-version.csvCopy the code
PSSH: 5 minutes series: CentOS batch configuration
Here’s what we got:
docker -v
Import CSV into Excel and simply clean the data
Let’s open up Excel
Open the Excel
Click “File” -> “Import”, select the CSV file we just created, then select the CSV type and click “Import” :
Import CSV
Select the separator method, we select the “separator” method:
Select the separation method
In the previous step, we chose to import the text using “delimiter”. In this step, we chose to use a comma to delimit the text, as shown below. In a preview, we can see that the comma has become a black vertical line, representing the column line:
respectively
Click “Next” and start formatting the column data (you can also drop the column – don’t import it)
I set it like this:
-
Click the first column in the “Preview Selected Data” section below and select the column data format as text
-
Click the second column in the “Preview selected data” section of the image below and select Not to import this column (skip)
Format columns or skip columns
After setting, click “Finish”, the next box appears, click the position of data import (a grid), click “OK” :
Select location
So our data import and cleaning is complete, 🎉🎉🎉
Use Excel PivotTable function to do simple counting statistics
Let’s start by manually inserting “Docker version” as the table header
(Right-click 1 on the left of the green box in the picture to insert)
Select the table header, hold Shift + Command and press ↓ (change the command key on non-Mac keyboards)
Then click “Insert” -> “PivotTable” on the upper TAB:
We have just selected the area, then select “Existing worksheet”, then “select a position (a grid) on the table”, click OK, and the following appears:
Configuring pivottables
If you look closely, there is a white line “Docker version” in the field name section, drag it to two locations:
-
Drag once to the row below
-
Drag to values below
As follows:
Field configuration
The default “value” on the right is summation (text does not add up, nor does it suit our needs)
Click the round exclamation mark on the right, change it to count, and then close the box
The final result
Double – click the Line label to modify the copy
Maybe some of you are confused. Why did you get from here to there? It doesn’t matter, open Excel operation again will be clear
End, scatter flowers 🎉
Focus on actual combat, for a wave of attention
My Zhihu · My Column · My GitHub · My Gist