~/devreads

#scripts

6 posts

20 Apr

20 Apr 2020

6 Feb 2020

16 May 2019

3 min read

Suppose you have a text file and you need to remove all of its duplicate lines. TL;DR To remove the duplicate lines preserving their order in the file use: awk '!visited[$0]++' your_file > deduplicated_file How it works The script keeps an associative array with indices equal to the unique lines of the file and values equal to their occurrences. For…

linuxbashscriptsfileawk

2 May 2019

7 min read

In this post we are going to manage nested objects of a document indexed with Elasticsearch. The nested type is a specialised version of the object datatype that allows arrays of objects to be indexed in a way that they can be queried independently of each other. – Nested datatype - Official Elasticsearch reference Prerequisites To follow this post you…

elasticsearchopensourcescriptshow-tonested objects

10 Apr 2019