Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I have following weblink:

http://www.rcsb.org/pdb/explore/sequenceText.do?structureId=1APS&chainId=A

I wish to save only certain parts of this file in a text file, that is, I want only the sequence portion (with spaces at correct places) and not the heading or any numbers on that page.

Secondly, we can see there are spaces after every tenth character in all lines. I would like to remove only the spaces which occur after every tenth character and save this content in another text file.

Is it possible ? Can any one help in this regard ?

share|improve this question
4  
I suggest to look up curl for downloading and awk for text processing. –  Lekensteyn Jun 9 '13 at 8:15
1  
legeksteyn is right, use curl or wget for downloading the file and use awk for text processing. but can you show your sample output that you want? –  nickanor Jun 9 '13 at 8:38

1 Answer 1

You can use egrep with -o switch (Show only the part of a matching line that matches PATTERN.) For example: echo page.html | egrep -o ".+" | sed s!!! | sed s!! > output.txt

share|improve this answer

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.