New answers tagged

1 vote

Extract substring between n and m delimiter

With zsh: print -rC1 -- input/*.mcool(N:t:r:r:r:r) (where the :t modifier gets you the tail, and :r the root (removes an extension) of the file like in csh or vim). Or: set -o histsubstpattern print -...
Stéphane Chazelas's user avatar
0 votes

Extract substring between n and m delimiter

If you know that it is the third /and fourth ., you may as well use awk and define fields according to / and . as delimiters: awk -F'[./]' '{print $7}'
FelixJN's user avatar
  • 11.8k
0 votes

Extract substring between n and m delimiter

If all input looks like ./../input/A001C007.hg38.nodups.pairs.mcool then the probably easiest approach is: start cmd:> sed -e 's+^./../input/++' -e 's/\..*$//' input A001C007 A001C008 If you want ...
Hauke Laging's user avatar
  • 86.5k
3 votes

Extract substring between n and m delimiter

for pathname in input/*.mcool; do basename "${pathname%%.*}" done This iterates over all names in the directory input that end in .mcool. For each pathname in $pathname, the pathname ...
Kusalananda's user avatar
  • 316k

Top 50 recent answers are included