Search Results

Search: Posts Made By: MOHANP12
5,092
Posted By yazu
With GNU utils everything is simpler but well......
With GNU utils everything is simpler but well... AIX 6

echo '20170001
20319900
20110232
20000001
20160230
20160229' | while read d; do
date -d$d '+%Y%m%d'; done
date: invalid date...
5,092
Posted By RudiC
Does it have to be awk? Pure shell:IFS="." read X...
Does it have to be awk? Pure shell:IFS="." read X X D1 D2 T E < $(ls mo*.txt)
[ 8 -eq ${#D1} ] && [ 12 -ge ${D1:4:2} ] && [ 31 -ge ${D1:6:2} ] && [ $D1 -gt 0 ] && echo OK || echo NOK
1,955
Posted By RudiC
Summing 5 CLP04 values - assuming that those are...
Summing 5 CLP04 values - assuming that those are $5 in CLP segments/records - is not that difficult: awk -F* '/^CLP/ {TOT+=$5;CNT++} CNT==5 {print TOT; TOT=CNT=0}' file
666.29
69.31

But, on top...
1,955
Posted By disedorgue
Hello, I'm not sure to understand your need... ...
Hello,
I'm not sure to understand your need...
Maybe as:
awk -F'*' 'OFS=FS;/^CLP/{$0=$0"="$5;$2="CLP01";$3="CLP02";$5="CLP04";print}' file

Regards.
6,188
Posted By RudiC
Use e.g. the code tag button. There's a...
Use e.g. the code tag button. There's a hint/description right above the editor window.
6,188
Posted By Don Cragun
Let me try one more time... It isn't clear...
Let me try one more time...

It isn't clear to me whether you are trying to print a single value indicating whether or not any line in the input file does not have exactly 3 field delimiters (0 if...
6,188
Posted By RavinderSingh13
Hello Mohanp12, Welcome to forums, please...
Hello Mohanp12,

Welcome to forums, please use code tags for commands/codes/Inputs which you are using in your posts as per forum rules. Following may help you in same.

awk -F"~|*" 'BEGIN{print...
Showing results 1 to 7 of 7

 
All times are GMT -4. The time now is 04:35 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy