Search Results

Search: Posts Made By: phani333
3,381
Posted By RudiC
You can look into mv's -v (verbose) option to...
You can look into mv's -v (verbose) option to log what is actually done.
While I could post some error handling for this very basic snippet, I'd suggest you play around with e.g. if [ "$SERIES" -ne...
3,381
Posted By RudiC
Upper case, lower case, or mixed case file names?...
Upper case, lower case, or mixed case file names? However, try
for FN in *.dat; do read X SERIES X <"$FN"; echo mv "$FN" "Target_$SERIES/$FN"; done
mv Claim25112016222930.dat...
3,381
Posted By RudiC
Any attempts/ideas/thoughts from your side?
Any attempts/ideas/thoughts from your side?
7,334
Posted By Franklin52
Use: $4==0 instead of: int($4)==0
Use:
$4==0

instead of:
int($4)==0
4,179
Posted By rdcwayx
awk 'BEGIN {a=1} $1=="0000"&&a==1...
awk 'BEGIN {a=1}
$1=="0000"&&a==1 {a++;print "H" $0;next}
$1=="0000"&&a==2 {a=1;print "T" $0;next}
$1=="5000" && $NF=="0" {print $0}
' urfile

But I don't understand how...
7,334
Posted By Franklin52
Try: awk -F, -v n=$(wc -l < file) ' NR < 7 ||...
Try:
awk -F, -v n=$(wc -l < file) '
NR < 7 || $3 ~ /[A-Za-z]/ || int($4)==0 {next}
NR==(n-2){exit}
1' file
7,334
Posted By Franklin52
Another one: awk -F, -v n=$(wc -l < file) ' ...
Another one:
awk -F, -v n=$(wc -l < file) '
NR < 7 || $3 ~ /[A-Za-z]/ || int($4)==0 {next}
NR==(n-2){exit}
{s+=$4}
END{if(!s)print "Sum is Zero" > "Logfile"}
1' file
Showing results 1 to 7 of 7

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