Renaming multiple paired files, deleting varying barcode character string in middle? The 2019...

When did F become S in typeography, and why?

Empty set is subset of every set? If yes, why that...

How to pronounce 1ターン?

Would an alien lifeform be able to achieve space travel if lacking in vision?

How do I add random spotting to the same face in cycles?

How to copy the contents of all files with a certain name into a new file?

Difference between "generating set" and free product?

how can a perfect fourth interval be considered either consonant or dissonant?

Are my PIs rude or am I just being too sensitive?

Why is the object placed in the middle of the sentence here?

system call string length limit

Who or what is the being for whom Being is a question for Heidegger?

Why does the Event Horizon Telescope (EHT) not include telescopes from Africa, Asia or Australia?

Is a pteranodon too powerful as a beast companion for a beast master?

Why can't devices on different VLANs, but on the same subnet, communicate?

How to delete random line from file using Unix command?

Scientific Reports - Significant Figures

Is every episode of "Where are my Pants?" identical?

Can the DM override racial traits?

How to test the equality of two Pearson correlation coefficients computed from the same sample?

Working through the single responsibility principle (SRP) in Python when calls are expensive

Hopping to infinity along a string of digits

What do you call a plan that's an alternative plan in case your initial plan fails?

Why not take a picture of a closer black hole?



Renaming multiple paired files, deleting varying barcode character string in middle?



The 2019 Stack Overflow Developer Survey Results Are In
Announcing the arrival of Valued Associate #679: Cesar Manara
Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern)
2019 Community Moderator Election ResultsMultiple renaming filesHow to loop through each file in FTP directory using a bash scriptrenaming diverse filesFind files in directory with paired namesRenaming multiple files with renamesed/awk deleting stringrenaming binary files in multiple subdirectories using awkHow do I use the output of a command for a process within a loop in Bash?Deleting text after a character multiple times in one columnRenaming Multiple files in different directories





.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ margin-bottom:0;
}







0















I have a bunch of paired files with unneeded barcode tags within the middle of the file



original filenames.



I need to get rid of the barcode (which varies throughout the files) without modifying identifiers at the beginning or end of the file.



I have tried writing a script myself from what I've read online, but it appears to be a relatively poor attempt (screenshot of script attached)



script



Here's the error message I get when I try to run it:



error message



Note that there are two types of error messages, first one I get, but I don't have duplicate file names in this folder so not sure why the second one is coming up.



Ideally, my final file name would be, for example:



LIB008983_TRA00020136_L001_R1.fastq.gz
LIB008983_TRA00020136_L001_R2.fastq.gz
LIB008983_TRA00020137_L001_R1.fastq.gz
LIB008983_TRA00020137_L001_R2.fastq.gz
..
..



and so on



Any pointers on how to do this? Any help/links would be appreciated.










share|improve this question







New contributor




ezhang1 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.



























    0















    I have a bunch of paired files with unneeded barcode tags within the middle of the file



    original filenames.



    I need to get rid of the barcode (which varies throughout the files) without modifying identifiers at the beginning or end of the file.



    I have tried writing a script myself from what I've read online, but it appears to be a relatively poor attempt (screenshot of script attached)



    script



    Here's the error message I get when I try to run it:



    error message



    Note that there are two types of error messages, first one I get, but I don't have duplicate file names in this folder so not sure why the second one is coming up.



    Ideally, my final file name would be, for example:



    LIB008983_TRA00020136_L001_R1.fastq.gz
    LIB008983_TRA00020136_L001_R2.fastq.gz
    LIB008983_TRA00020137_L001_R1.fastq.gz
    LIB008983_TRA00020137_L001_R2.fastq.gz
    ..
    ..



    and so on



    Any pointers on how to do this? Any help/links would be appreciated.










    share|improve this question







    New contributor




    ezhang1 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
    Check out our Code of Conduct.























      0












      0








      0








      I have a bunch of paired files with unneeded barcode tags within the middle of the file



      original filenames.



      I need to get rid of the barcode (which varies throughout the files) without modifying identifiers at the beginning or end of the file.



      I have tried writing a script myself from what I've read online, but it appears to be a relatively poor attempt (screenshot of script attached)



      script



      Here's the error message I get when I try to run it:



      error message



      Note that there are two types of error messages, first one I get, but I don't have duplicate file names in this folder so not sure why the second one is coming up.



      Ideally, my final file name would be, for example:



      LIB008983_TRA00020136_L001_R1.fastq.gz
      LIB008983_TRA00020136_L001_R2.fastq.gz
      LIB008983_TRA00020137_L001_R1.fastq.gz
      LIB008983_TRA00020137_L001_R2.fastq.gz
      ..
      ..



      and so on



      Any pointers on how to do this? Any help/links would be appreciated.










      share|improve this question







      New contributor




      ezhang1 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.












      I have a bunch of paired files with unneeded barcode tags within the middle of the file



      original filenames.



      I need to get rid of the barcode (which varies throughout the files) without modifying identifiers at the beginning or end of the file.



      I have tried writing a script myself from what I've read online, but it appears to be a relatively poor attempt (screenshot of script attached)



      script



      Here's the error message I get when I try to run it:



      error message



      Note that there are two types of error messages, first one I get, but I don't have duplicate file names in this folder so not sure why the second one is coming up.



      Ideally, my final file name would be, for example:



      LIB008983_TRA00020136_L001_R1.fastq.gz
      LIB008983_TRA00020136_L001_R2.fastq.gz
      LIB008983_TRA00020137_L001_R1.fastq.gz
      LIB008983_TRA00020137_L001_R2.fastq.gz
      ..
      ..



      and so on



      Any pointers on how to do this? Any help/links would be appreciated.







      shell-script awk






      share|improve this question







      New contributor




      ezhang1 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.











      share|improve this question







      New contributor




      ezhang1 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.









      share|improve this question




      share|improve this question






      New contributor




      ezhang1 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.









      asked 10 mins ago









      ezhang1ezhang1

      1




      1




      New contributor




      ezhang1 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.





      New contributor





      ezhang1 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.






      ezhang1 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.






















          0






          active

          oldest

          votes












          Your Answer








          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "106"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: false,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: null,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });






          ezhang1 is a new contributor. Be nice, and check out our Code of Conduct.










          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f512329%2frenaming-multiple-paired-files-deleting-varying-barcode-character-string-in-mid%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          0






          active

          oldest

          votes








          0






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes








          ezhang1 is a new contributor. Be nice, and check out our Code of Conduct.










          draft saved

          draft discarded


















          ezhang1 is a new contributor. Be nice, and check out our Code of Conduct.













          ezhang1 is a new contributor. Be nice, and check out our Code of Conduct.












          ezhang1 is a new contributor. Be nice, and check out our Code of Conduct.
















          Thanks for contributing an answer to Unix & Linux Stack Exchange!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f512329%2frenaming-multiple-paired-files-deleting-varying-barcode-character-string-in-mid%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          Hudson River Historic District Contents Geography History The district today Aesthetics Cultural...

          The number designs the writing. Feandra Aversely Definition: The act of ingrafting a sprig or shoot of one...

          Ayherre Geografie Demografie Externe links Navigatiemenu43° 23′ NB, 1° 15′ WL43° 23′ NB, 1°...