Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

4
  • I have tired your solution but its printing everything in single like like foo-010101-5-4.example.com: 1 Var. Speed System Board Normal Yes Normal ( 19) Commented Aug 8, 2018 at 23:03
  • I suspect your output isn't just spaces as you're showing in the example data, is it? Commented Aug 8, 2018 at 23:05
  • my file is correct and i am replacing file with my filename.txt Commented Aug 8, 2018 at 23:12
  • I showed this style of example b/c unlike the awk you can more easily add/remove portions of this solution to see how it's working. Each /../; block in the sed is doing something specific, you can take them all out and then add them back in 1 at a time to see how they work and work towards you solution rather than have to have a lot of knowledge about awk. Commented Aug 8, 2018 at 23:13