| | |
Extract particular data from a css file
Please support our VB.NET advertiser: Intel Parallel Studio Home
![]() |
•
•
Join Date: Feb 2009
Posts: 2
Reputation:
Solved Threads: 0
Ok, here is the issue.
I have a xyz.css file which I read using the streamreader.
the file has text in the form
.Addfont { ......
.GridLayout {......
a.Master Layout {......
Now I need to extract the text between the '.' and '{'
In this case it would be
Addfont
GridLayout
Master Layout
How should I go about this.... I tried using the readline() method but it didn't work for the '{'
Please help me
Thank you
I have a xyz.css file which I read using the streamreader.
the file has text in the form
.Addfont { ......
.GridLayout {......
a.Master Layout {......
Now I need to extract the text between the '.' and '{'
In this case it would be
Addfont
GridLayout
Master Layout
How should I go about this.... I tried using the readline() method but it didn't work for the '{'
Please help me
Thank you
•
•
Join Date: Apr 2008
Posts: 45
Reputation:
Solved Threads: 10
Have you tried just reading in the lines and splitting based on the "." and "{"?
In my limited testing, that seems to give me what you were looking for.
VB Syntax (Toggle Plain Text)
Dim streamRead as StreamReader = new StreamReader("xyz.css") Dim input As String = streamRead.ReadLine() Dim splitParams as String() = {".", "{"} Dim cssClass as String If input.StartsWith(".") Then cssClass = input.Split(splitParams, StringSplitOptions.RemoveEmptyEntries)(0).Trim() Else cssClass = input.Split(splitParams, StringSplitOptions.RemoveEmptyEntries)(1).Trim() End If
In my limited testing, that seems to give me what you were looking for.
Last edited by bcasp; Feb 13th, 2009 at 9:43 am.
![]() |
Similar Threads
- validation (JavaScript / DHTML / AJAX)
- Help with automatic update problem and more (Viruses, Spyware and other Nasties)
- Problem in setting text extracted from database in Textarea in ASP (ASP)
- Short guide to include RSS on your website (PHP)
Other Threads in the VB.NET Forum
- Previous Thread: querying records
- Next Thread: Multi-Line Text Tool
| Thread Tools | Search this Thread |
Tag cloud for VB.NET
"crystal .net 2008 access add advanced application array assignment basic beginner box button buttons center click client code combo convert cpu data database datagrid datagridview designer dissertation dissertations dosconsolevb.net editvb.net employees excel exists firewall forms function html images isnumericfuntioncall listview map math memory mobile module msaccess mssqlbackend mysql navigate net number opacity open page pan picturebox picturebox2 port print printing printpreview problem record regex reuse right-to-left save search serial socket sorting sqldatbase sqlserver storedprocedure structures studio temp textbox timer txttoxmlconverter upload useraccounts usercontol vb vb.net vb.nettoolboxvisualbasic2008sidebar vb2008 vba vbnet vista visual visualbasic visualbasic.net visualstudio.net visualstudio2008 web winsock wpf wrapingcode xml





