Answers.Body: <pre><code>$ echo "Mtss1/Sox11/Fbn2/Mmp2/..." | tr '/' '\n' &gt; list.txt
  </code></pre>
  
  <p>For more information on <code>tr</code>: <a href="https://en.wikipedia.org/wiki/Tr_(Unix)" rel="nofollow noreferrer">https://en.wikipedia.org/wiki/Tr_(Unix)</a></p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-09-27T17:35:56.163Z
Answers.Text: It works well in my terminal, thank you so much!
Answers.UserDisplayName: Lin
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-09-27T16:36:03.530Z
Answers.LastActivityDate: 2019-09-27T16:36:03.530Z
Answers.UserDisplayName: Alex Reynolds
Answers.Body: <p>Many ways, assuming you're on a *nix system. </p>
  
  <ol>
  <li><p><code>tr</code>. Alex <a href="https://bioinformatics.stackexchange.com/a/10503/298">already gave you</a> a fine <code>tr</code> solution, but here's another approach assuming you have an input file:</p>
  
  <pre><code>tr / '\n' &lt; golist.txt &gt; newlist.txt
  </code></pre></li>
  <li><p><code>sed</code></p>
  
  <pre><code>sed 's|/|\n|g' golist.txt &gt; newlist.txt
  </code></pre>
  
  <p>Or, to edit the original file:</p>
  
  <pre><code>sed -i 's|/|\n|g' golist.txt
  </code></pre></li>
  <li><p>Perl</p>
  
  <pre><code>perl -pe 's|/|\n|g' golist.txt &gt; newlist.txt
  </code></pre>
  
  <p>Or, to edit the original file:</p>
  
  <pre><code>perl -i -pe 's|/|\n|g' golist.txt 
  </code></pre></li>
  <li><p><code>grep</code> (GNU <code>grep</code>, the default on Linux systems)</p>
  
  <pre><code>grep -Eo '[^/]+' golist.txt &gt; newlist.txt
  </code></pre></li>
  </ol>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-09-27T17:38:58.387Z
Answers.Text: Thank you all very much!
Answers.UserDisplayName: Lin
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-09-27T17:40:26.833Z
Answers.Text: @Lin you're very welcome. If one of the answers solved your issue, please take a moment to [accept it](//$$SITEURL/help/accepted-answer) by clicking on [the checkmark on the left](https://meta.stackexchange.com/a/5235/203101). That will mark the question as answered and is the way that thanks are conveyed on the Stack Exchange sites. Since Alex answered first, you might want to accept his.
Answers.UserDisplayName: terdon
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-09-27T16:51:33.170Z
Answers.LastActivityDate: 2019-09-27T17:03:33.350Z
Answers.LastEditDate: 2019-09-27T17:03:33.350Z
Answers.UserDisplayName: terdon
Answers.Body: <p>In R you can use <code>tidyr</code>'s function <code>separate_rows</code>.</p>
  
  <pre><code>install.packages("tidyr") ## if not already installed
  library(tidyr)
  GO_results&lt;-read.table("genes.txt")
  separate_rows(GO_results, GO_results$V1, sep = "/")
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-09-30T08:26:09.477Z
Answers.LastActivityDate: 2019-09-30T08:46:58.107Z
Answers.LastEditDate: 2019-09-30T08:46:58.107Z
Answers.UserDisplayName: benn
Body: <p>I got two lists of about 300 genes from my GO analysis, like the following:</p>
  
  <pre><code>Mtss1/Sox11/Fbn2/Mmp2/Tcf7l2/Six2/Ahr/Fat4/Lef1/Stc1/Acvr2a/Glis1/Nog/Igsf10/Twist2/Igf1/...
  </code></pre>
  
  <p>How can I convert the list to one element per row (for Venn diagram  on Venny 2.1), as:</p>
  
  <pre><code>Mtss1
  Sox11
  Fbn2
  Mmp2
  ...
  </code></pre>
  
Tags: <go-enrichment>
Title: How to convert a list of genes to one element per row?
ThreadText: # How to convert a list of genes to one element per row?
  
  (Asked by: username_0 on 2019-09-27)
  
  I got two lists of about 300 genes from my GO analysis, like the following:
  
  ```
  Mtss1/Sox11/Fbn2/Mmp2/Tcf7l2/Six2/Ahr/Fat4/Lef1/Stc1/Acvr2a/Glis1/Nog/Igsf10/Twist2/Igf1/...
  
  ```
  
  How can I convert the list to one element per row (for Venn diagram on Venny 2.1), as:
  
  ```
  Mtss1
  Sox11
  Fbn2
  Mmp2
  ...
  
  ```
  
  **Tags:** go-enrichment
  
  
  ---
  
  ## 3 answers
  
  ### Answer by username_1 on 2019-09-27. Score: 2
  
  ```
  $ echo "Mtss1/Sox11/Fbn2/Mmp2/..." | tr '/' '\n' > list.txt
  
  ```
  
  For more information on `tr`: <https://en.wikipedia.org/wiki/Tr_(Unix)>
  
  > **Comments:**
  > **username_0**: It works well in my terminal, thank you so much!  
  
  ---
  
  ### Answer by username_3 on 2019-09-30. Score: 1
  
  In R you can use `tidyr`'s function `separate_rows`.
  
  ```
  install.packages("tidyr") ## if not already installed
  library(tidyr)
  GO_results<-read.table("genes.txt")
  separate_rows(GO_results, GO_results$V1, sep = "/")
  
  ```
  
  
  ---
  
  ### Answer by username_2 on 2019-09-27. Score: 0
  
  Many ways, assuming you're on a \*nix system.
  
  1. `tr`. username_1 [already gave you](https://bioinformatics.stackexchange.com/a/10503/298) a fine `tr` solution, but here's another approach assuming you have an input file:
  
     ```
     tr / '\n' < golist.txt > newlist.txt
  
     ```
  2. `sed`
  
     ```
     sed 's|/|\n|g' golist.txt > newlist.txt
  
     ```
  
     Or, to edit the original file:
  
     ```
     sed -i 's|/|\n|g' golist.txt
  
     ```
  3. Perl
  
     ```
     perl -pe 's|/|\n|g' golist.txt > newlist.txt
  
     ```
  
     Or, to edit the original file:
  
     ```
     perl -i -pe 's|/|\n|g' golist.txt 
  
     ```
  4. `grep` (GNU `grep`, the default on Linux systems)
  
     ```
     grep -Eo '[^/]+' golist.txt > newlist.txt
  
     ```
  
  > **Comments:**
  > **username_0**: Thank you all very much!  
  > **username_2**: @username_0 you're very welcome. If one of the answers solved your issue, please take a moment to [accept it](//$$SITEURL/help/accepted-answer) by clicking on [the checkmark on the left](https://meta.stackexchange.com/a/5235/203101). That will mark the question as answered and is the way that thanks are conveyed on the Stack Exchange sites. Since username_1 answered first, you might want to accept his.  
  
  ---
  
  