1# For extracting a transcode_compat_manifest from a csv file in the format 2# package_name,hevc_support,slow_motion_support,hdr_10_support,hdr_10_plus_support,hdr_hlg_support,hdr_dolby_vision_support,hevc_support_shift,slow_motion_support_shift,hdr_10_support_shift,hd_10_plus_support_shift,hdr_hlg_support_shift,hdr_dolby_vision_support_shift,media_capability 3# com.foo,1,0,0,0,0,0,1,0,0,0,0,0,1 4# .... 5function transcode_compat_manifest() { 6 # Cat file 7 # Remove CLRF (DOS format) 8 # Remove first line (header) 9 # Extract first and last columns in each line 10 # For device_config convert new lines (\n) to comma(,) 11 # For device_config remove trailing comma(,) 12 case "$1" in 13 -r) cat $2 | tr -d '\r' | sed 1d | awk -F "," '{new_var=$1","$NF; print new_var}';; 14 -d) cat $2 | tr -d '\r' | sed 1d | awk -F "," '{new_var=$1","$NF; print new_var}' | tr '\n' ',' | sed 's/,$//g';; 15 *) "Enter '-d' for device_config, '-r' for resource";; 16 esac 17 echo 18} 19