Answers.Body: <p>If we save the script pasted in the main post as a sh file and we have some .vcf files in a folder, by this line we can iterate over vcf files to extract what mentioned in the script returning .txt output by the name of corresponding vcf</p>
  
  <p><code>for file in *.vcf ; do bash indel_vcf_parasing.sh $file ; done</code></p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-01-06T14:50:38.580Z
Answers.Text: Can you provide some context to future readers about this answer
Answers.UserDisplayName: Bioathlete
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-01-06T18:57:38.907Z
Answers.Text: This is generally the method I use for scaling. Write a program to do 'one', then write wrappers, or use one-liners (as this answer shows) to do many.
  
  You will need to be sure that successive runs do not step on each other (if using a single directory for all runs), or make a new directory for each run if necessary.
Answers.UserDisplayName: Scot
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-01-07T15:08:16.980Z
Answers.Text: Please edit your answer to include the extra details so the answer is complete and a user doesn't have to read all the comments to understand.
Answers.UserDisplayName: Bioathlete
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-01-06T11:36:28.780Z
Answers.LastActivityDate: 2020-01-07T15:28:39.057Z
Answers.LastEditDate: 2020-01-07T15:28:39.057Z
Answers.UserDisplayName: Zizogolu
Body: <p>I have a bash script:</p>
  
  <p>I am wondering how I can change this script to loop over a bunch of .vcf files and give output .txt with the name of corresponding .vcf </p>
  
  <p>I tried changes done in similar script in  <a href="https://bioinformatics.stackexchange.com/questions/11061/changing-this-code-in-a-way-to-work-for-my-files/11067?noredirect=1#comment15031_11067">Changing this code in a way to work for my files</a> but I just  messed everything up</p>
  
Tags: <vcf><bash><linux><wgs>
Title: Looping over several files in bash
ThreadText: # Looping over several files in bash
  
  (Asked by: username_0 on 2020-01-04)
  
  I have a bash script:
  
  I am wondering how I can change this script to loop over a bunch of .vcf files and give output .txt with the name of corresponding .vcf
  
  I tried changes done in similar script in [Changing this code in a way to work for my files](https://bioinformatics.stackexchange.com/questions/11061/changing-this-code-in-a-way-to-work-for-my-files/11067?noredirect=1#comment15031_11067) but I just messed everything up
  
  **Tags:** vcf, bash, linux, wgs
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_0 on 2020-01-06. Score: 2 | Accepted answer
  
  If we save the script pasted in the main post as a sh file and we have some .vcf files in a folder, by this line we can iterate over vcf files to extract what mentioned in the script returning .txt output by the name of corresponding vcf
  
  `for file in *.vcf ; do bash indel_vcf_parasing.sh $file ; done`
  
  > **Comments:**
  > **username_1**: Can you provide some context to future readers about this answer  
  > **username_2**: This is generally the method I use for scaling. Write a program to do 'one', then write wrappers, or use one-liners (as this answer shows) to do many.  You will need to be sure that successive runs do not step on each other (if using a single directory for all runs), or make a new directory for each run if necessary.  
  > **username_1**: Please edit your answer to include the extra details so the answer is complete and a user doesn't have to read all the comments to understand.  
  
  ---
  
  