I have the below CSV file. I would like to be able to convert it so I have IDs without URLs.

```
tID,type,usageID,Usage,status,tStatus,proParte,sName,snID,canName,scAuth,pnuID,tRank,trSort,King,class,subclass,family,created,modified,datasetName,tcID,Ref,refID,tRemarks,tDist,hClass,fhpName,fhpnID,shpn,shpnID,nomCode,Lic,ccaID
https://some-url.com/tree/90000607/90000610,scientific,https://some-url.com/tree/90000607/90000610,Bacteria,,accepted,f,Bacteria,https://some-url.com/name/bbni/90000608,Bacteria,,,Regnum,10,Bacteria,,,,2018-12-06 14:48:14.395+11,2018-12-06 14:48:14.708+11,BBC,https://some-url.com/instance/bbni/90000609,TWD,https://some-url.com/reference/bbni/90000596,,,Bacteria,,,,,ABC,-,/tree/90000607/90000610

```

I would like to accomplish the following one of two outcomes. I have tried different things using `sed piping` it through a few times, but I am unable to do it in one command using `regEx`.

*Option 1:*

```
tID,type,usageID,Usage,status,tStatus,proParte,sName,snID,canName,scAuth,pnuID,tRank,trSort,King,class,subclass,family,created,modified,datasetName,tcID,Ref,refID,tRemarks,tDist,hClass,fhpName,fhpnID,shpn,shpnID,nomCode,Lic,ccaID
tree/90000607/90000610,scientific,tree/90000607/90000610,Bacteria,,accepted,f,Bacteria,name/bbni/90000608,Bacteria,,,Regnum,10,Bacteria,,,,2018-12-06 14:48:14.395+11,2018-12-06 14:48:14.708+11,BBC,instance/bbni/90000609,TWD,reference/bbni/90000596,,,Bacteria,,,,,ABC,-,/tree/90000607/90000610

```

*Option 2:*

```
tID,type,usageID,Usage,status,tStatus,proParte,sName,snID,canName,scAuth,pnuID,tRank,trSort,King,class,subclass,family,created,modified,datasetName,tcID,Ref,refID,tRemarks,tDist,hClass,fhpName,fhpnID,shpn,shpnID,nomCode,Lic,ccaID
90000610,scientific,90000610,Bacteria,,accepted,f,Bacteria,90000608,Bacteria,,,Regnum,10,Bacteria,,,,2018-12-06 14:48:14.395+11,2018-12-06 14:48:14.708+11,BBC,90000609,TWD,90000596,,,Bacteria,,,,,ABC,-,90000610

```

If someone can assist with what you have done before, it would help me out. 

**Things I Tried:**

```
#!/bin/bash
sed -e 's/[a-z]*:\/\/[a-z]*.[a-z]*.[a-z]*\/[a-z]*\/[a-z]*\/[a-z]*\/[a-z]*//g' BBC-taxon-2019-03-26-4546.csv > test.csv
sed -e 's/[0-9]\/[0-9]/[0-9]|[0-9]/g' test.csv

```

Above code needs to to write a command for each type of replacement and create a new file each time, so I gave up.

```
#!/bin/bash
# Set Input File here...
input="BBC-taxon-2019-03-26-4546.csv"

# Check if file exists
[ ! -f $input ] && { echo "No file with name: $input. File not found"; exit 123; }

# Set file separator and read fields into variables
while IFS=',' read -ra fields;
do
  echo "Fields: ${fields[*]}"
  echo "Number of Elements: ${#fields[@]}"
  echo "Each Element has: ${#fields}"
  for i in "${fields[@]}"
  do
    echo $i
  done

#  fields[0] = ${fields[0]} 
done < "$input"

```

The above code creates a iterable array but I don't know how I can use `sed` on each value cell for a certain column. If anyone can help, that is great.