6
rated 0 times
[
6]
[
0]
/ answers: 1 / hits: 17862
/ 1 Year ago, wed, april 5, 2023, 10:03:52
I am looking for a bash script. In a text file I have data like:
+------+------
| Id | User |
+------+------+
| 8192 | root |
| 8194 | root |
| 8202 | root |
| 8245 | root |
| 8434 | root |
| 8754 | root |
| 8761 | root |
| 8762 | root |
| 8764 | root |
| 8771 | root |
+------+------+
I want to extract the data like this:
8192,8194,8202,8245,8434,8754,8761,8762,8764
I mean, I need the first field containing numbers, but not the last one, and all the numbers extracted should be separated by commas (,
).
Could somebody help me to get it ?
More From » bash