Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

6
  • 2
    What does fmt -w29 do? Commented Feb 26, 2024 at 13:44
  • 1
    OP's filenames had length 14. What you see is copy-n-paste output from a run of BSD / MacOS fmt -- OP did not specify an execution platform. I refer you to the fmt man page: "Lines are joined or split only at white space". When porting this solution to fmt (GNU coreutils) 8.32, I see they apparently introduced an OBOB or made an undocumented change in the meaning of "maximum line width", as we find that at least fmt -w30 is needed. (I will update my Answer to use 30.) Commented Feb 26, 2024 at 16:38
  • 1
    Not sure I understand. Let's say A1, A2, etc. are primer-set names, and R1/R2 are the paired reads. The sequencing software outputs files with these two strings joined via _ underscore. But what happens if some primer-set names are A1, A2, etc., while others are GTAAAACGACGGCCAG (i.e. the string length varies from primer-set to primer-set)? Commented Feb 26, 2024 at 21:53
  • 1
    I'm just trying to understand your fmt approach, because it seems powerful. However AIUI to use fmt an end-user has to make the assumption that input linewise character lengths ('filenames', in this example), are non-varying. The fmt approach could work just fine for some identifiers (e.g. Ensembl_IDs (such as ENSRNOG00000000007, ENSRNOG00000071217, etc.), which seemingly maintain consistent length. Thank you. Commented Feb 26, 2024 at 22:16
  • 2
    @jubilatious1 Depending on the naming scheme of the files, they definitely do not need to be of uniform length (it is common to use species names as a part of the filename, and the length of these varies greatly). I would advise against using this approach (with fmt) as a generic solution. Commented Feb 27, 2024 at 9:51