I have data rows that look like this:
sp_A0A342_ATPB_COFAR_6_+_contigs_full.fasta sp_A0A342_ATPB_COFAR_9_-_contigs_full.fasta sp_A0A373_RK16_COFAR_10_-_contigs_full.fasta sp_A0A373_RK16_COFAR_8_+_contigs_full.fasta sp_A0A4W3_SPEA_GEOSL_15_-_contigs_full.fasta
How can I use sed to remove parts of a row after the 4th column (_ separately) for each row. Finally, having received:
sp_A0A342_ATPB_COFAR sp_A0A342_ATPB_COFAR sp_A0A373_RK16_COFAR sp_A0A373_RK16_COFAR sp_A0A4W3_SPEA_GEOSL
linux unix bash sed
neversaint
source share