LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 11-12-2005, 09:35 AM   #1
rblampain
Senior Member
 
Registered: Aug 2004
Location: Western Australia
Distribution: Debian 11
Posts: 1,288

Rep: Reputation: 52
cleaning up CSS file


I have been building a site that has now some hundreds of HTML pages using a CSS external file. This CSS file is very messy and some of the tags have been removed from the HTML pages but I don't know exactly which one.

My question: is there an easy to use piece of software to fix this problem?

The need is to get a list of the CSS tags used in the HTML pages so that I can remove those that aren't in the list.

My knowledge is not good enough to try that with BASH and I thought about writing a little program in BASIC to do the job if there is nothing else already.

Your help or comments are most appreciated.
 
Old 11-12-2005, 03:31 PM   #2
keefaz
LQ Guru
 
Registered: Mar 2004
Distribution: Slackware
Posts: 6,552

Rep: Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872
You could use :
Code:
cd /your/site/dir
grep -r ' class="' . | \
sed -r -e 's/.*class="(\w+)".*/\1/' | \
sort -u > result.txt
That will create and fill result.txt with the sorted list of CSS style used in
the class="style" parameter
 
Old 11-12-2005, 11:35 PM   #3
rblampain
Senior Member
 
Registered: Aug 2004
Location: Western Australia
Distribution: Debian 11
Posts: 1,288

Original Poster
Rep: Reputation: 52
Thanks keefaz, it does the job nicely.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Cleaning up an old PC Merlyn Linux - Hardware 8 10-25-2005 06:33 AM
problem in linking css file in xml geethu Programming 0 09-10-2005 05:51 AM
css question tekmorph Programming 10 09-04-2004 09:21 PM
dnsmasq cleaning up leases file TheRealDeal Linux - Networking 0 03-02-2004 11:12 PM
cleaning up? phonecian Linux - Software 1 10-19-2003 06:27 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 06:16 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration