Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I would like convert text into a table. Here is a link to the text

http://www.tcdb.org/public/tcdb

Short example:

>gnl|TC-DB|A0CIB0|1.A.17.3.1 Chromosome undetermined scaffold_19, whole genome shotgun sequence OS=Paramecium tetraurelia GN=GSPATT00007662001 PE=4 SV=1
MDDQNQPILQEQPKPKQKKPLLNTKMVKKQKMQNKKEENLREILNFYTNQVDARKFLQKM
KAVVDSNQQEKKYQDDFLNPNEYNEMQDIYEDYNMGDLVIVFPNPDADGVKNPPITYKEA
PLTKTNFYSKIGNVSYENDIDELCVDEMEYLRNMRNVDGEHMDQDHVKEEI
>gnl|TC-DB|A0CS82|9.B.82.1.5 Chromosome undetermined scaffold_26, whole genome shotgun sequence - Paramecium tetraurelia.
MIIEEQIEEKMIYKAIHRVKVNYQKKIDRYILYKKSRWFFNLLLMLLYAYRIQNIGGFYI
VTYIYCVYQLQLLIDYFTPLGLPPVNLEDEEEDDDQFQNDFSELPTTLSNKNELNDKEFR
PLLRTTSEFKVWQKSVFSVIFAYFCTYIPIWDIPVYWPFLFCYFFVIVGMSIRKYIKHMK
KYGYTILDFTKKK

I wanted to have columns for example delimited with pipe | or ;

|>gnl|TC-DB|A0CIB0|1.A.17.3.1| Chromosome undetermined scaffold_19, whole genome shotgun sequence OS=Paramecium tetraurelia GN=GSPATT00007662001 PE=4 SV=1|
MDDQNQPILQEQPKPKQKKPLLNTKMVKKQKMQNKKEENLREILNFYTNQVDARKFLQKM
KAVVDSNQQEKKYQDDFLNPNEYNEMQDIYEDYNMGDLVIVFPNPDADGVKNPPITYKEA
PLTKTNFYSKIGNVSYENDIDELCVDEMEYLRNMRNVDGEHMDQDHVKEEI

I am working with Windows and I don't know how to do it

I just know

  • every row starts with >
  • I want to substitute the first whitespace in a row with a delimiter like | or ;
  • after the first regular expression new line in a row, I want also a delimiter
  • everything between the regular expression first new line and > should go into a new column (it's a sequence of a protein)
share|improve this question
1  
Welcome to Super User! Our formatting works a little different — you'll have to indent code by 4 spaces or press Ctrl-K. Can you check your post and see if it's displayed correctly now? –  slhck Oct 10 '12 at 14:51
    
What OS are you doing this in? That will determine what tools are available. –  EBGreen Oct 10 '12 at 15:01
    
Windows, as stated @ebg –  slhck Oct 10 '12 at 15:18
    
sorry I should have been more clear. Which version of windows? –  EBGreen Oct 10 '12 at 17:41
add comment

1 Answer

If I was in your situation, I'd try an editor with Regular Expression support. This question has some suggestions for editors as the answers.

You could also use perl, or another programming language with strong Regular Expression support. You can get a version of perl from ActiveState, or as part of Cygwin. Cygwin also has editors with Regular Expression support, but for a nice GUI editor you would need to download and configure the X-Server portion of Cygwin and that may be a steep learning curve for you to jump.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.