Tag Info

New answers tagged

0

For records. this seems to be working, none of the other option worked sort -t "," -k2,2 -k1,1 -r output.txt| awk -F "," '!a[$2]++'|head -100


0

500 million rows is a lot of data so you may want to be looking a more scalable way to handle the job. That said doing this with standard Linux utilities is achievable. Assuming your data is in a file called data.txt you can print it to the terminal using cat: $ cat data.txt 1616.93,ac:22:0b:a6:22:c3 2872.32,c0:bd:d1:36:bb:49 3314.55,d4:0b:1a:39:19:b2 ...


1

try BEGIN { srand() ;r=0 ; FS="," ; before="" ; } { if ( $1 > V[$2]) V[$2]=$1 ; if ( before != $2 && before != "" ) { r=rand()*100 ; if ( r > 50 ) printf "%s,%s\n",V[before],before ; } before=$2 ; } data-file.txt where if ( $1 > V[$2]) V[$2]=$1 ; get max value for mac if ( before != $2 && ...


2

The solution is actually almost too simple: foo | column without any arguments to column does the trick. I think I have never actively used column without -t before. Thanks to steeldriver for the suggestion to leave out this argument.


0

Another option: echo $(foo) | fold where you can specify -w WIDTH to use something other than 80 columns.


0

This command prints out chars 4 to 500 of every line of file.gff, hence cutting out the first 3 chars, and saves the results in newfile.gff: cut -c4-500 file.gff > newfile.gff Increase the upper bound accordingly if your lines are longer than 500 chars.



Top 50 recent answers are included