I have few random numbers which I retrieve from a database. Eg.
12203770
6458251
6458250
10336719
10366878
10366877
10366874
81048
Now, I have to place the delimiter "/" in between them. I am using this command:
[root@abc01 ~]# awk 'BEGIN{FS="";OFS="/"} {print $1,$2,$3,$4,$5}' /tmp/abc.txt
This works fine if numbers are 8 digits but my requirement
is :
The command/script should leave last 3 digit from right and for rest, it prints digit with delimiter.
Desired output required:
1/2/2/0/3
6/4/5/8
6/4/5/8
1/0/3/3/6
1/0/3/6/6
1/0/3/6/6
1/0/3/6/6
8/1
Kindly help.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…