Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have following weblink:

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
I suggest to look up curl for downloading and awk for text processing. – Lekensteyn Jun 9 '13 at 8:15
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

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


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.