Skip to main content

Timeline for Group items from column using awk

Current License: CC BY-SA 4.0

14 events
when toggle format what by license comment
Jul 3, 2019 at 1:36 comment added netkool hi @steeldriver I did update the expected answer, what I was looking is: ` Eth1 Eth101/1 Eth103/1 Gi0 ` wanted to capture the middle value /1/
Jul 2, 2019 at 22:27 comment added steeldriver @netkool if you have additional requirements, please edit your question - it's hard to understand what you are asking given the limits of code formating in comments
Jul 2, 2019 at 22:23 comment added netkool From the above text file, like to get the extra / as well so the expected result: Eth1 Eth101/1 Eth103/1 Gi0
Jul 2, 2019 at 22:21 vote accept netkool
Jul 2, 2019 at 20:40 comment added netkool @steeldriver I would like to get the following output, is there any way to capture /1/ as well ``` Eth1 Eth101/1 Eth103/1 Gi0 ```
Jun 14, 2019 at 20:40 comment added steeldriver @netkool please see updated answer
Jun 14, 2019 at 20:40 history edited steeldriver CC BY-SA 4.0
added output formatting
Jun 14, 2019 at 19:16 vote accept netkool
Jul 2, 2019 at 22:21
Jun 14, 2019 at 19:16 comment added netkool Thanks @steeldriver for the explanation, make sense now, is it possible to print in one line with comma Eth1,Eth101,Eth103,Gi0 removing the \n thanks
Jun 13, 2019 at 18:49 vote accept netkool
Jun 14, 2019 at 19:16
Jun 13, 2019 at 18:43 comment added glenn jackman @netkool, this is a awk idiom to do something only the very first time some field is encountered.
Jun 13, 2019 at 18:41 comment added steeldriver @netkool seen is just an array - its name is arbitrary (you could use a[$1]++ or foo[$1]++ etc.)
Jun 13, 2019 at 18:40 comment added netkool Thanks, never use seen interesting
Jun 13, 2019 at 18:37 history answered steeldriver CC BY-SA 4.0