shell - filter file content to sorted tables -


i have file contains following lines of code. here file displays schedules sorted 1 one .

at 12:00 schedule of james version1 : first_task:eating:nothing second_task:rest:onehour third_task:watching:nothing   @ 12:00 schedule of james version2 : first_task:eating:fruits second_task:rest:twohour third_task:watching:manga   @ 12:00 schedule of alex version1 : first_task:eating:fruit second_task:rest:halfhour third_task:watching:horrorfilm   @ 12:00 schedule of alex version2 : first_task:eating:meal second_task:rest:nothing third_task:watching:nothing   @ 18:00 schedule of james version1 : first_task:eating:fastfood second_task:rest:twohours third_task:watching:series   @ 18:00 schedule of james version2 : first_task:eating:nothing second_task:rest:onehours third_task:watching:series   @ 18:00 schedule of alex version1 : first_task:eating:vegetals second_task:rest:threehours third_task:watching:manga   @ 18:00 schedule of alex version2 : first_task:eating:bread second_task:rest:fivehours third_task:watching:manga   @ 22:00 schedule of james version1 : first_task:eating:nothing second_task:rest:sevenhours third_task:watching:nothing  @ 22:00 schedule of james version2 : first_task:eating:meal second_task:rest:sixnhours third_task:watching:nothing  @ 22:00 schedule of alex version1 : first_task:eating:vegetals second_task:rest:sevehours third_task:watching:manga   @ 22:00 schedule of alex version2 : first_task:eating:icecream second_task:rest:sevenhours third_task:watching:nothing  

i've tried sort way :

12:00 eating:fruit 18:00 eating:vegetals 22:00 eating:nothing  12:00 rest:onhour  18:00 rest:threehour 22:00 rest:sevenhour  12:00 watching:horrorfilm  18:00 watching:manga 22:00 watching:nothing 

using these commands :

awk -f '[\ :]' '/the schedule is/{h=$2;m=$3} /eating/{print " "h":"m" watching:"$3}' f.txt awk -f '[\ :]' '/the schedule is/{h=$2;m=$3} /rest/{print " "h":"m" rest:"$3}' f.txt awk -f '[\ :]' '/the schedule is/{h=$2;m=$3} /watching/{print " "h":"m" watching:"$3}' f.txt 

now looking improve filtered file ignoring non significant words , sorting valuable information in table , i've tried think/search how format in vain .


Comments

Popular posts from this blog

python - No exponential form of the z-axis in matplotlib-3D-plots -

php - Best Light server (Linux + Web server + Database) for Raspberry Pi -

c# - "Newtonsoft.Json.JsonSerializationException unable to find constructor to use for types" error when deserializing class -