Search results

  1. S

    Creating a grouped tab separated file with a flat list

    I was able to get this resolved using ChatGPT: cat test.txt | sed -z 's/\r\n\^/,/g' | tr -d '|' | awk -F, "{ key = \$1; for (i=2; i<=NF; i++) { values[key][\$i] = values[key][\$i]\",\"\$i } } END { for (key in values) { for (value in values[key]) { printf \"%s%s\n\", key, values[key][value] } }...
  2. S

    Creating a grouped tab separated file with a flat list

    Crosspost: https://www.nixcraft.com/t/converting-a-list-into-a-tab-separated-file-grouped-by-values/4517 Hello Linux.org, This is my first post here and I'm hoping the community is inviting to novice shell scripters. So let me share. I have a text file with a list of values. Here is a snip...
Top