Posts

Showing posts with the label AWK

Using awk for data manipulation - Unix & Linux Stack Exchange

Image
   Important AWK commands: This blog is useful for beginner and intermediate data engineers who want to do advance in the filed of data engineering and data administration.     To listen to you tube video please click link below: AWK A few More Cases Day 2 Day usage Following are 5 examples which may be  used in daily use cases to solve real time problems. 1. Many a times we deal with configuration file such as .config and .YAML file (which is mostly used in java projects). Data storage happens as Key-Value pair in these configuration files,  the key and value are separated by a separator such as colon (:) or equal to(=) sign, for example weather_detail.config is shown as below. we need to retrieve the value for the key "Country" config, yaml Solution A. awk -F : '{ if($1=='Country') print $2}' weather_detail.config Solution B. cat <filename> |grep 'Country' | awk -F : '{print $2}' weather_detail.config Region:APAC Country:India 2.  In si