10

Is there currently a generic command that will "pivot" input.

e.g.

#labeled.file
name: bob
title: code monkey

name: joe
title: pointy haired

is converted to:

name title
bob  code monkey
joe  pointy haired

and vice-versa

Joseph R.
  • 39,549
frogstarr78
  • 1,002
  • @slm Not really. This question is probably about whether there exists a utility with this job as its main purpose. – Joseph R. Aug 25 '13 at 22:49
  • @JosephR. - it's borderline I agree but still felt like a duplicate. Takes 5 votes to be labeled as such so if 4 others agree, otherwise nothing happens. – slm Aug 25 '13 at 23:00

1 Answers1

6

I'm not sure there's something in coreutils that can do this, but it seems your question has been asked before by people not necessarily interested in an existing tool like you seem to be. The following links may be interesting to you as a last resort in case you can't find a tool that already does this.

For what it's worth, you may want to take a look at the GNU coreutils manual, especially the 4th section

Joseph R.
  • 39,549
  • Yeah, it doesn't HAVE to be in coreutils. But I figured there was something already out there and know coreutils has similar type commands. – frogstarr78 Aug 25 '13 at 22:19
  • @frogstarr78 I understand and for all I know there might be such a command out there. I included the coreutils manual so you can at least rule out the existence of such a command in that bundle. Feel free to unaccept the answer and wait for a more enlightened one. – Joseph R. Aug 25 '13 at 22:38
  • No worries. I frequent the coreutils docs. Never quite found anything useful. Suspect pr could work. But it's crazy complicated. Per your suggestions this is prob a dup post anyway and likely will be rm'd. Thanks though. – frogstarr78 Aug 25 '13 at 22:50