Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

combine all lines with same value of a column unix

cat FILENAME | perl -e 'foreach $Line (<STDIN>) { @Cols=($Line=~/^s*(d+)s*(.*?)s*$/); push(@{$Link{$Cols[0]}}, $Cols[1]); } foreach $List (values %Link) { print join("	", @{$List})."
"; }'
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #combine #lines #column #unix
ADD COMMENT
Topic
Name
4+9 =