Hi RudiC
thank you kindly for the code it works nicely in normal linux arch but not in ARM arch
#!/bin/bash
usage()
{
echo "usage: sysinfo_page [[-f file ] | [-h]]"
}
while [ "$1" != "" ]; do
case $1 in
-f | --file ) shift
filename1=$1
;;
-h | --help ) usage
exit
;;
* ) usage
exit 1
esac
shift
done
#cd /tmp/runfiles/tmp
awk -F, '
NR == 1 {$1 = "timestamp"
print
next
}
{cmd = "date +\"%F %T\" -d@" $1
cmd | getline $1
close (cmd)
$2 = $2 ".0"
if ($3) $3 = $3 ".0"
}
1
' OFS=, $filename1
against and actual collectd CSV
epoch,rx,tx
1534477715.852,29429474,724680066
1534477720.854,29433801,724682823
1534477725.852,29437903,724685952
1534477730.852,29439120,724688043
1534477735.852,29446691,724691078
1534477740.852,29452624,724692719
1534477745.852,29457362,724696536
1534477750.852,29461215,724699053
1534477755.852,29465872,724701793
1534477760.853,29466906,724703284
1534477765.853,29471367,724705629
1534477770.852,29475009,724707836
1534477775.852,29480881,724711779
1534477780.852,29484515,724714005
1534477785.852,29488975,724716416
1534477790.854,29490008,724717907
1534477795.852,29495013,724720064
1534477800.852,29498611,724722541
1534477805.852,29502482,724724656
1534477810.852,29506624,724727067
1534477815.852,29510496,724729182
1534477820.852,29512315,724731298
1534477825.852,29516186,724733413
1534477830.852,29520328,724735824
1534477835.852,29525286,724739184
1534477840.852,29529670,724741993
1534477845.853,29533541,724744108
1534477850.852,29535210,724745937
1534477855.852,29539081,724748052
1534477860.852,29543353,724750463
1534477865.852,29549652,724752686
1534477870.852,29553840,724755247
1534477875.852,29557620,724756738
1534477880.852,29559465,724759244
1534477885.852,29566161,724762681
1534477890.852,29570349,724765242
under ARM I get invalid date whereas in X86_64 it works fine
how would I insert my above awk time shift into your code,, As I remember it was a bit of a bugger to get awk time to work correctly under ARM
awk 'BEGIN {FS=OFS=","}{$1=strftime("%Y-%m-%d %T",$1)
------ Post updated at 09:33 PM ------
hi RudiiC
I modified your code slightly
awk -F,
' NR == 1 {$1 = "timestamp"
print
next
}
{$1=strftime("%Y-%m-%d %T",$1)
$2 = $2 ".0"
if ($3) $3 = $3 ".0"
} 1 ' OFS=, file
now it works in both ARM and X86_64
and again thank you kindly for your help