This is a test version of Biostars. For the public version, visit https://www.biostars.org.
listing library names

Dear all

I have a folder which contains the GBS libs, but I need to prepare a list of the available lib with this format. could you help me?

Thanks

libs name in floder:

CC_12.R1.fq.gz
CC_12.R2.fq.gz

C_1.R1.fq.gz
C_1.R2.fq.gz

BB_16.R1.fq.gz
BB_16.R2.fq.gz


  output list format:

   CC_12
   C_1
   BB_16
bash

2 answers

Here is another

ls *.fq.gz | sed 's/.R[12].fq.gz//' | sort -u > list_of_libraries

Any one them:

$  parallel echo {= s/\\..*// =} ::: *.gz| sort -ur
$  for i in *.gz; do echo ${i%%.*};done | sort -ur
$  ls *.gz| cut -f1 -d"." | sort -ur

Log in to answer this question.