I have a text file with thousands of lines, I want to update those lines by making a few changes.
original lines:
b1522 ftp://ftp.genecard.giv.nlm.org/genome/all/ABC_001596115.1_ASM159611v1#
dd1120 ftp://ftp.genecard.giv.nlm.org/genome/all/ABC_231146189.1_ASM159611v1#
desired output:
b1522 ftp://ftp.genecard.giv.nlm.org/genome/all/ABC/001/596/115/ABC_001596115.1_ASM159611v1#
dd1120 ftp://ftp.genecard.giv.nlm.org/genomes/all/ABC/231/146/189/ABC_231146189.1_ASM159611v1#
I want to copy from "ABC" to the last number before the ".", paste them within two forward slashes after "all", delete underscore and place forward slash after every three characters. I have no idea how to go about it with awk. my awk knowledge is quite basic