Skip to content

Instantly share code, notes, and snippets.

@fouad-j
fouad-j / sh
Created October 27, 2016 23:07
Allow to filter data with awk
awk 'BEGIN {FS=";"}
((length($2)>5 || length($3)==7) && length($4)==0) {print "OK " $0; next}
{print "KO " $0}
' file
# input data
# col11OK;col12;col13
# col21;col22OK;col23
@fouad-j
fouad-j / FooBarQix
Last active December 29, 2015 18:41
import java.util.Map;
import java.util.TreeMap;
public class FooBarQix {
// TreeMap sort key 3 > 5 > 7 for priority
private static final TreeMap<Integer, String> FOOBARQIX = new TreeMap<Integer, String>() {{
put(7, "Qix");
put(3, "Foo");
put(5, "Bar");