Parsing a text

Hi there!
Does somebody can tell me how can I “parse” the
content of a variable (html text) to multiple movieclip/textfields.
I unsuccessfully tried to with bottomScroll and maxScroll...
Many thanks in advance for any help!

Hello ewon15!
Thanks for responding.
A brief survey of the operations:
On my site users perform searches
(Flash-->PHP-->MySQL).
Results are most often html lists or texts.
They are displayed in scrollable dynamic text fields.
And, most often, result displayed is only a part of the total
result.
The total result often exceeds the dimensions of a printed
page.
At the moment, I send the variable value (the "total result")
to a built-in movie clip named PRINTMC which contains a dynamic
text field named printFld.
PRINTMC contains:
first frame label "#p" and printFld, stop();
second frame "#b" and a 600x800 bounding box
I have also built two other movie clips named PRINTMCTWO and
PRINTMCTHREE identicals to PRINTMC and ready to receive, if
necessary, the continuation of what will be printed on the first
page.
Of course I only get printed, at the moment, the first part
of the total result.
The part which fits the page.
The problem is:
How to parse myPrintStr (see attached code) to have it
printed in full ?

Similar Messages

  • Parsing "HTML" text for AttributedString

    Well basically im writing a little instant messaging application where one user can speak to another.
    At the moment i have everything working fine, but now i want to move onto the next step. Using tags to create effects, i want to base my system on HTML since it's simple enough for people to follow and im comfortable using it.
    So anyway, im attempting to write a class which parses the text and then turns it into a java.text.AttributedString object.
    However, im stuck, i could write a class which would parse the commands (hopefully) and append the start and end of the command to the attributedstring while removing the tags as it goes along.
    But i can't think of a way to make it so that you can parse multiple commands and for example, with colour, you might have a large number or a small number so there is no definate size.
    If anyone could help me out with this i would be very gratefull and satisfied.
    Thank you for any help.

    i_own_pking wrote:
    But i can't think of a way to make it so that you can parse multiple commands and for example, with colour, you might have a large number or a small number so there is no definate size.First option that came to mind would be to split up the user's input by tags so you separate the tags from the text:
    <b><font color=red>This would be bold red font</font> whereas </b> this is <i>italicized</i>.
    Becomes:
    <b>    <font color=red>    This would be bold red font    </font>   whereas     </b>     this is    <i>    italicized    </i>    .Then you can put each segment into a tree, with each tag starting a new level in a tree (lets see if I can represent this visually):
    Root
       - <b>
          - <font color=red>
             - This would be bold red font
          - </font>
          - whereas
       - </b>
       - this is
       - <i>
          - italicized
       - </i>
       - .Then you could just do an in-order traversal of the tree, checking to see what html tag each node is, and applying it to all the leafs below that node (notice whereas is still below bold, but same level as the font, so the font color doesn't apply to it but the bold does, since it is a leaf below the node for bold).
    Edited by: bogdana on Jan 23, 2010 11:20 AM
    (messed up the grouping of the visual representation; fixed)

  • Parsing of text in JSP

    hai, I am new to java and I wanna know how can i parse a text using StringTokenizer and then add them all(integers). I tried this but doesnt work.plz help.
    <% int sum[];
    try{
    if(request.getParameter("result").indexOf("+")>=0){
    StringTokenizer st=new StringTokenizer(request.getParameter("result"), "+");
    while(st.hasMoreTokens()){
    sum=Integer.parseInt(st.nextElement());
    }}catch(Exception e){}
    %>
    appreciate ur help
    qs

    Hi
    Since you are using '+' as a delimiter my guess is that in your request URL you have gien: '?result=19+10'
    The problem with this is that the browser formats data that it sends to a server from a form in a similar fashion in that it puts a '+' for a blank space between values, So when the server interprets this it takes the '+' and inserts a blank space betweeen the values so if you provide result=8+9 then the servlet receives 8 9.....This gives you a NumberFormatException when trying to parse the Token. Instead try giving :
    http://server-name:port-number/servlet-name?result=19,10
    and in your servlet code put:
    StringTokenizer tokens = new StringTokenizer(param,",");
    This should work...
    Keep me posted on your progress.
    Good Luck!
    Eshwar Rao
    Developer Technical Support
    Sun microsystems Inc.
    http://www.sun.com/developers/support

  • How to parse a text on a transition with OCL? is it possible ?

    Hi Everyone,
    I was just wondering if it is possible to put constraints between a transition on a state machine and a variable/attribute in a class diagram ? for example, to make sure if the user writes [X++] as a guard for a transition in state machine, the X attribute exists in the corresponding class diagram.
    Is it even possible with OCL? I think maybe it should be coded to parse the text... Any idea will be appreciated
    Thanks,
    Parsa

    Hi
    For OMG OCL, yes, since the capability is implied by the UML
    specification. However there are gaping chasms between the UML and OCL
    specifications, so any useable implementation relies on vendor intuition.
    For the new pivot-based Eclipse OCL, quite possibly. The UML support is
    primarily for Class Diagram elements, but is kind of extensible in so
    far as for unsupported UML elements, 'self' is aligned to the nearest
    containing Class. This works for statemachines, and could work for
    transitions. Activity diagrams are known to not work.
    Regards
    Ed Willink
    On 29/06/2015 18:02, Parsa Pourali wrote:
    > Hi Everyone,
    >
    > I was just wondering if it is possible to put constraints between a
    > transition on a state machine and a variable/attribute in a class
    > diagram ? for example, to make sure if the user writes [X++] as a
    > guard for a transition in state machine, the X attribute exists in the
    > corresponding class diagram.
    >
    > Is it even possible with OCL? I think maybe it should be coded to
    > parse the text... Any idea will be appreciated :)
    >
    > Thanks,
    > Parsa

  • VBScript for parsing multiple text files

    Hi,
    I have around 175 text files that contain inventory information that I am trying to parse into an Excel file. We are upgrading our Office platform from 2003 to 2010 and my boss wants to know which machines will have trouble supporting it. I found a script
    that will parse a single text file based upon ":" as the delimiter and I'm having trouble figuring out how to change it to open an entire folder of text files and write all of the data to a single Excel spreadsheet. Here is an example of the text
    file I'll be parsing. I'm interested in the "Memory and Processor Information" and "Disk Drive Information" sections mainly.
    ABEHRENS-XP Computer Inventory
    OS Information
    OS Details
    Caption: Microsoft Windows XP Professional
    Description:
    InstallDate: 20070404123855.000000-240
    Name: Microsoft Windows XP Professional|C:\WINDOWS|\Device\Harddisk0\Partition1
    Organization: Your Mom
    OSProductSuite:
    RegisteredUser: Bob
    SerialNumber: 55274-640-3763826-23029
    ServicePackMajorVersion: 3
    ServicePackMinorVersion: 0
    Version: 5.1.2600
    WindowsDirectory: C:\WINDOWS
    Memory and Processor Information
    504MB Total memory HOW CAN I PULL THIS WITHOUT ":" ALSO
    Computer Model: HP d330 uT(DG291A)
    Processor:               Intel(R) Pentium(R) 4 CPU 2.66GHz
    Disk Drive Information
    27712MB Free Disk Space ANY WAY TO PULL THIS WITHOUT ":"
    38162MB Total Disk Space
    Installed Software
    Here is the start of the script I have so far. . .
    Const ForReading = 1
    Set objDict = CreateObject("Scripting.Dictionary")
    Set objFSO = CreateObject("Scripting.FileSystemObject")
    Set objTextFile = objFSO.OpenTextFile("C:\Test\test.txt" ,ForReading)
    WANT THIS TO BE C:\Test
    Do Until objTextFile.AtEndOfStream
    strLine = objTextFile.ReadLine
    If Instr(strLine,":") Then
    arrSplit = Split(strLine,":") IS ":" THE BEST DELIMITER TO USE?
    strField = arrSplit(0)
    strValue = arrSplit(1)
    If Not objDict.Exists(strField) Then
    objDict.Add strField,strValue
    Else
    objDict.Item(strField) = objDict.Item(strField) & "||" & strValue
    End If
    End If
    Loop
    objTextFile.Close
    Set objExcel = CreateObject("Excel.Application")
    objExcel.Visible = True
    objExcel.Workbooks.Add
    intColumn = 1
    For Each strItem In objDict.Keys
    objExcel.Cells(1,intColumn) = strItem
    intColumn = intColumn + 1
    Next
    intColumn = 1
    For Each strItem In objDict.Items
    arrValues = Split(strItem,"||")
    intRow = 1
    For Each strValue In arrValues
    intRow = intRow + 1
    objExcel.Cells(intRow,intColumn) = strValue
    Next
    intColumn = intColumn + 1
    Next
    Thank you for any help.

    You are The Bomb.com! I had to play around with it to pull some additional data (model and processor) and then write a quick macro to remove the unwanted text and finally I wanted the data to write in columns instead of rows so this is what I ended up with:
    Option Explicit
    Dim objFSO, objFolder, strFolder, objFile
    Dim objReadFile, strLine, objExcel, objSheet
    Dim intCol, strExcelPath
    Const ForReading = 1
    strFolder = "c:\Test"
    strExcelPath = "c:\Test\Inventory.xlsx"
    Set objExcel = CreateObject("Excel.Application")
    objExcel.Workbooks.Add
    Set objSheet = objExcel.ActiveWorkbook.Worksheets(1)
    intCol = 0
    Set objFSO = CreateObject("Scripting.FileSystemObject")
    Set objFolder = objFSO.GetFolder(strFolder)
    For Each objFile In objFolder.Files
      intCol = intCol + 1
      Set objReadFile = objFSO.OpenTextFile(objFile.Path, ForReading)
      Do Until objReadFile.AtEndOfStream
        strLine = objReadFile.ReadLine
        If (InStr(strLine, "Computer Inventory") > 0) Then
          objSheet.Cells(intCol, 1).Value = Left(strLine, InStr(strLine, "Computer Inventory") - 2)
        End If
        If (InStr(strLine, "Total memory") > 0) Then
          objSheet.Cells(intCol, 2).Value = Left(strLine, InStr(strLine, "Total memory") - 2)
        End If
        If (InStr(strLine, "Computer Model:") > 0) Then
          objSheet.Cells(intCol, 3).Value = (strLine)
        End If
        If (InStr(strLine, "Processor:") > 0) Then
          objSheet.Cells(intCol, 4).Value = (strLine)
        End If
        If (InStr(strLine, "Total Disk Space") > 0) Then
          objSheet.Cells(intCol, 5).Value = Left(strLine, InStr(strLine, "Total Disk Space") - 2)
        End If
        If (InStr(strLine, "Free Disk Space") > 0) Then
          objSheet.Cells(intCol, 6).Value = Left(strLine, InStr(strLine, "Free Disk Space") - 2)
        End If
      Loop
    Next
    objExcel.ActiveWorkbook.SaveAs strExcelPath
    objExcel.ActiveWorkbook.Close
    objExcel.Quit
    Thanks again!
    Hi ,
    I am have very basic knowledge about VB scripting, but this code could be the perfect solution i am looking for. could you guide me exactly how to run and test the same , i would be really thankful for your kind and generous support on this.
    Thanks ,
    Veer

  • Parse file text file

    Hi,
    I like read Apache error log using external table.
    For this I did create directory APACHE_LOG and grant read permission to it for my schema.
    Then external table
    CREATE TABLE EXT_APACHE_ERROR_LOG
        "TEXT" VARCHAR2(2000 BYTE)
      ORGANIZATION EXTERNAL
        TYPE ORACLE_LOADER DEFAULT DIRECTORY "APACHE_LOG" ACCESS PARAMETERS ( records delimited BY newline nobadfile nodiscardfile nologfile ) LOCATION ( "APACHE_LOG":'error.log' )
      REJECT LIMIT UNLIMITED;Log format is like below
    [Wed Oct 11 14:32:52 2000] [error] [client 127.0.0.1] client denied by server configuration: /export/home/live/ap/htdocs/testI have try read file using query
    SELECT REGEXP_SUBSTR(text, '[^\[]+(.*?)')      AS mesg_date,
      REGEXP_SUBSTR(text, '\[([a-z]*?)\]')         AS mesg_type,
      REGEXP_SUBSTR(text, '\[client ([0-9\.]*)\]') AS client,
      REGEXP_SUBSTR(text, '\] (.*)$')              AS mesg
    FROM ext_apache_error_log;Output it is not quite what I like have as I'm bad with regexp.
    I like have result in 4 columns like
    MESG_DATE               MESG_TYPE     CLIENT          MESG
    Wed Oct 11 14:32:52 2000     error          127.0.01     client denied by server configuration: /export/home/live/ap/htdocs/testSo I need bit help
    What is best method parse that log format?
    Can I have those 4 columns some way already to external table?
    Thanks advance
    Regards,
    Jari

    Hi,
    I just noticed that log have lines where is no data for third column (client).
    This query demonstrate situation
    WITH test_data AS
      (SELECT '[Wed Oct 11 14:32:52 2000] [error] [client 127.0.0.1] client denied by server configuration: /export/home/live/ap/htdocs/test' text
      FROM dual
      UNION ALL
      SELECT '[Wed Oct 11 14:32:52 2000] [notice] SIGUSR1 received.  Doing graceful restart' text
      FROM dual
    SELECT REGEXP_replace(text, '^\[(.*?)\].*$', '\1')   AS mesg_date,
      REGEXP_SUBSTR(text, '\[(.*?)\]',1,2)               AS mesg_type,
      REGEXP_SUBSTR(text, '\[(.*?)\]',1,3)               AS client,
      REGEXP_replace(text, '^(\[.*?\]\s){3}(.*)$', '\2') AS mesg
    FROM test_data ;In case there is no client info whole line from file is in fourth column (mesg).
    What could be best way handle this case so that client column is null but only the message should shown in mesg column ?
    Thanks advance
    Regards,
    Jari
    Edited by: jarola on Aug 31, 2011 8:24 PM
    I did come to this query
    WITH test_data AS
      (SELECT '[Wed Oct 11 14:32:52 2000] [error] [client 127.0.0.1] client denied by server configuration: /export/home/live/ap/htdocs/test' text
      FROM dual
      UNION ALL
      SELECT '[Wed Oct 11 14:32:52 2000] [notice] SIGUSR1 received.  Doing graceful restart' text
      FROM dual
    SELECT TO_DATE(REGEXP_REPLACE(text, '^\[(.*?)\].*$', '\1'),'Dy Mon DD HH24:MI:SS YYYY', 'NLS_DATE_LANGUAGE = AMERICAN') AS mesg_date,
      REGEXP_SUBSTR(text, '\[(.*?)\]',1,2)                                                                                  AS mesg_type,
      REGEXP_SUBSTR(text, '\[(.*?)\]',1,3)                                                                                  AS client,
      REGEXP_REPLACE(REGEXP_REPLACE(text, '^(\[.*?\]\s){3}(.*)$','\2'), '^(\[.*?\]\s){2}(.*)$','\2')                        AS mesg
    FROM test_data ;It seems work. If somebody have better query please post.
    And also if there is in good way combine expression that remove opening bracket and closing bracket from MESG_TYPE and CLIENT columns.
    Thanks

  • Help with parsing a text string in address book and moving it to 'related person' field

    I am wanting to make a little applescript that will go thru my contacts and find data in the NOTES field and parse it slightly and move it to another field.  (sorry if parsing isn't the right word here)
    The data to be found is a GPS coordinate with this EXACT format:
    <Lat:12.345678><Lon:-12.345678>
    ...the only thing different from this example is the digits, and the number of digits.
    What I want to end up doing is deleting this data from the NOTES field, but leaving any other data, (this part sounds difficult to do to, to me!)
    And moving it to a related person field with the label gps, and the coordinate now reading exactly:
    12.345678,-12.345678
    (FYI, you can copy/paste a coordinate like this very fast into the maps app on iPhone and locate it instantly)
    Thanks for the help on this
    If this is too complicated I can break up the process into steps.  I know how to do some of it, but not sure about the parsing, and then delete just part of the notes field...
    Thanks!

    Hi,
    This script work here, try it :
    tell application "Address Book"
        repeat with thisContact in (get people)
            set tNote to note of thisContact
            if tNote is not missing value and "<Lat:" is in tNote and "<Lon:" is in tNote then
                set {GPS_value, newNote} to my getGPS_coordinate(tNote)
                if newNote is not "" then -- no error
                    set gpsField to (related names of thisContact whose its label = "gps")
                    if gpsField is not {} then
                        set value of (item 1 of gpsField) to GPS_value
                    else -- field "gps" is empty
                        make new related name at end of related names of thisContact with properties {label:"gps", value:GPS_value}
                    end if
                    set note of thisContact to newNote
                end if
            end if
        end repeat
        save
    end tell
    on getGPS_coordinate(this_note)
        set oldTid to text item delimiters
        set {tLat, tLon, newNote} to {"", "", ""}
        try
            set text item delimiters to "<Lat:"
            set tLat to text item 2 of this_note
            set text item delimiters to "<Lon:"
            set tLon to text item 2 of this_note
            set text item delimiters to ">"
            set {tLat, tLon} to {text item 1 of tLat, text item 1 of tLon} -- get values (lat... and long...)
            set text item delimiters to "<Lat:" & tLat & "><Lon:" & tLon & ">"
            set this_note to text items of this_note
            set text item delimiters to " "
            set newNote to this_note as string -- delete GPS coordinate in this note
        end try
        set text item delimiters to oldTid
        return {tLat & "," & tLon, newNote}
    end getGPS_coordinate

  • Using a scanner to parse a text file

    Hi,
    I'm running into some difficulties using a pattern for my scanner (java.util.Scanner). I need to scan a text file which consists of records. Each record has a keyword and a value (like property files):
    Example:
    FACILITY=TEST
    LOT=1234567
    DEVICE=abcdefgNormally, every record will be ended by a carriage return and line feed. So what I did was using a scanner with cr/lf as delimiter. That worked fine for most records but there are some records which span several lines (with cr/lf at the end of each line), e.g.:
    MAP_XY.01.01=" Y-7 24/10 Y-6 24 22/17 15/7 Y-5 29/7 5 Y-4 32/22 20
    19/15 13/4 Y-3 34/24 22/13 11/2 Y-2 36/30 28/24 22
    21/12 10/4 2/0 Y-1 38/0 Y0 40/35 33/22 20/15 13/0 Y1 41
    40/32 30/8 6/-1 Y2 42/26 24/-2 Y3 42/-5 Y4 47/11 9
    8/3 1/-6 Y5 48/47 45/39 37/18 16/-7 Y6 49/8 6/-8 Y7 49
    47/8 6/4 2/-8 Y8 50/9 7/3 1/-9 Y9 51/11 9/-10 Y10 51
    50/33 31/-10 Y11 52/40 38/35 33/23 21/16 14/-11 Y12 52
    51/34 32/15 13/4 2/-11 Y13 53/40 38/35 33/-12 Y14 53
    52/35 33/27 25/18 16/13 11/9 7 5 2/0 -4/-12 Y15 53
    52/-12 Y16 53/22 20/-5 -7/-13 Y17 54/47 45/-7 -9/-13 Y18 54
    53/22 20 18/2 0/-13 Y19 55/16 14/13 11/-2 -4/-13 Y20 55
    53/41 39/35 33/-14 Y21 55/52 50/48 46/16 14/10 8/-2 -4
    -6/-14 Y22 54/33 31/7 5/4 2/0 -2/-9 -11/-13 Y23 55
    54/53 51/26 24/-2 -4/-13 Y24 55/15 13/-14 Y25 55 53
    52/-7 -9/-10 -12/-14 Y26 54/44 42/14 12/10 8/-4 -6
    -7/-10 -12/-13 Y27 55/52 50/23 20/16 14/-13 Y28 54
    53/12 10/-1 -3/-13 Y29 55/44 42/-13 Y30 55/15 13/10 8
    7/-13 Y31 55/17 15/-13 Y32 54/44 42/-1 -3/-13 Y33 54
    53/41 39/30 28/-13 Y34 54 52/37 35/19 17/12 9/8 5/3 1
    0/-4 -6 -9/-11 Y35 54/-13 Y36 54/35 33/31 29/13 11
    10/2 0/-2 -4/-13 Y37 54/-13 Y38 53/11 9/0 -2/-9 -11
    -12 Y39 53/35 33/31 29/-12 Y40 53/22 20/15 13/-12 Y41 52
    50/15 13/10 8/-11 Y42 52/11 9/5 3/-6 -8/-11 Y43 51
    50/41 39/10 8/0 -2/-10 Y44 51/28 26 24/15 13/12 10
    9/-10 Y45 50/43 41/32 30/4 2/-9 Y46 49/31 29/13 11
    10/-8 Y47 49/47 45/30 28/24 22/-8 Y48 48/42 40 38/12 10
    9/-7 Y49 47/42 40/38 36/-6 Y50 44/33 31/30 28/6 4/-5 Y51 44
    43/28 26/17 15/13 11/-2 Y52 44/32 30/-2 Y53 43/32 30
    29/13 11/-2 Y54 42/27 25/24 22/16 9 7/-1 Y55 41/21 19
    18/0 Y56 39/15 13/6 4 2 Y57 38/20 18/3 Y58 36/5 Y59 34
    33 31/30 28/7 Y60 31/28 26/10 Y61 27/14"
    BIN_COUNT.01.09=12345Using the following delimiter does not work
    fileScanner.useDelimiter("\\s*=\\s*");because the result would be something like:
    keyword: FACILITY     value: TEST
    LOTkeyword: 1234567
    DEVICE     value: abcdefgWhat I need is a pattern which also handles carriage return/line feed until a new keyword (like LOT for example) occurs.
    The correct result should be:
    keyword: FACILITY     value: TEST
    keyword: LOT            value: 1234567
    keyword: DEVICE     value: abcdefg
    keyword: MAP_XY.01.01 value: " Y-7 24/10 Y-6 24 22/17 15/7 Y-5 29/7 5 Y-4 32/22 20...
    {code}
    I hope, I did explain clearly enough...
    Any help would be appreciated.
    Thanks and best regards
    - Stephan                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

    Any help would be appreciated.You have grouping and data in the groupings and you are attempting to parse it all at one go.
    Won't work. (Might in a perfect world but not in this one.)
    You need a parsers that do the following
    1. Parser text file (stream) into records.
    2. Parse records into data.
    You can put both into one class or not.
    Your record parser is going to be based roughly on the following scheme.
    1. Find keyword,
    2. Look up format defined for keyword
    3. Attempt to read format found.
    4. Error if format not found.
    5. Else return the record found.
    I say roughly because as noted above you need to know what the actual output looks like. It is possible to determine this if you have enough examples but it is a lot easier if you actually get the specification that tells you what it looks like.
    I suspect, but don't know that the "format" in the above will consist of the following.
    <word><text>
    or
    <word><text>
    <space><text>
    <space><text>
    You could just create one format for the all but you will likely have record types that don't fit that and the earlier you detect errors the better.

  • Please recommend a  tool or framework that parsing delimited text to XML

    Working on a project that need me read data from delimited text file, the data will be converted to a tree-structure. So it's better parse the data into XML format first.
    Besides j2se or jdom, any fast tool for it?
    Thank you

    alex888 wrote:
    Working on a project that need me read data from delimited text file, the data will be converted to a tree-structure. So it's better parse the data into XML format first.What??? Why? You've got a text file and need an object tree, why do you think going to XML in between is a good idea?
    Besides j2se or jdom, any fast tool for it?What do you mean with "j2se", that's not a XML handling tool (it contains several, 'though).
    SAX sounds good for building object trees from XML, but there are several XML mapping libraries out there (try google).

  • Need help Loading parsed RSS text

    Hi, I have created an AS3 FLA where I am parsing and
    displaying RSS text. I have traced the parsed text and displayed
    the text into dynamic text boxes on the stage no problem.
    However the line breaks in the traced text show up on stage
    as well.
    How does one strip out the <p> or </r> tags from
    the text to make the text one nice long line that will wrap using
    the length of the text box as it's parameters?

    OK, I have found the answer, thanks all.
    var myvar:String = myDynamicText.text;
    myDynamicText.text = myvar.split("\r").join(" ");
    myDynamicText.text = myDynamicText.text.split("\n").join("

  • Remove HTML Tags and parse the text out of it

    Hi All -
    I had a text file with all the HTML Tags on it. I want to parse text out of it. Is there any package available to remove all the HTML Tags from the text.
    For example
    <HTML><BODY bgColor=#ffffff> This is the text i want to parse.</BODY></HTML>
    The result would be: This is the text I want to parse.
    The text can be very long and can have many different HTML Tags. I cannot use REPLACE becuase tags can me lot more then I thought.
    Please respond as soon as possible..Thanks for all your help!!
    Anuj Sharma

    thank you all, but my code is only html no xml , and is other application that save in table
    <html><head><title>Aprovação de ARC</title></head><body><font face=arial size=2><b>974-17016/ugadiego-2013</b></font><br><br><table border=0><tr><td><b><font face=arial size=1>Data da Abertura</font></b></td>    <td><font face=arial size=1>8/3/2013</font></td><tr><td><b><font face=arial size=1>Quebra Produtividade</font></b></td>    <td><font face=arial size=1>Sim</font></td><tr><td><b><font face=arial size=1>Quantidade</font></b></td>    <td><font face=arial size=1>17,5</font></td><tr><td><b><font face=arial size=1>Valor</font></b></td>    <td><font face=arial size=1>R$ 17496</font></td><tr><td><b><font face=arial size=1>Forma de Indenização</font></b></td>    <td><font face=arial size=1>Nota de Crédito</font></td><tr><td><b><font face=arial size=1>Observação</font></b></td>    <td><font face=arial size=1>Evidenciado a não conformidade do produto em visita a cliente pela assessoria agronômica e qualidade.
    Produto apresenta-se empedrado com desuniformidade de grânulos e por consequência geração de finos e falha de óleo.
    Produto expedido com GDAP.
    Bonificar o cliente em 10% do valor da compra = R$ 17.496,00 ou em toneladas e fertilizantes  que podem ficar em forma de crédito para o cliente retirar em fertilizante para o plantio  da soja. Conforme relatório do Sr. Ademilson Palharin em anexo.</font></td><tr><td><b><font face=arial size=1>Centro de Custo</font></b></td>    <td><font face=arial size=1>CAS1I4671 - MISTURA E ENSAQUE I                     </font></td></table><hr><font face=arial size=2><b>Favor incluir uma Observação (Se necessário) e selecionar o botão desejado para aprovar ou reprovar essa Indenização.</b></font><FORM ACTION='http://10.176.10.123/pgAprovaARCServidor.asp' METHOD='GET' ><font face=arial size=2><div>Observações:</div><textarea name='txtObs' rows='4' cols='60' maxlength='4000'></textarea><br><br><div><input type='submit' value='Aprovar'  name='acao'> <input type='submit' value='Reprovar' name='acao'></div></font><br><hr><font face=arial size=2 >Essa é uma mensagem automática.<br>Favor não responder esse email</font><hr><input type='hidden' name='cdARC' value='17016' ><input type='hidden' name='cdSeq' value='1' ><input type='hidden' name='cdFase' value='Indenizacao' ><input type='hidden' name='dsResp' value='ustrenat' ><input type='hidden' name='dsCargo' value='Vice Presidência' ><input type='hidden' name='dsSolic' value='LESIANE CIESLAK' ><input type='hidden' name='index' value='3' ><input type='hidden' name='rowatu' value='3' ></FORM></body></html>using oracle 9.2.08
    Edited by: muttleychess on Mar 19, 2013 11:36 AM

  • Parsing a Text file with nulls in records

    Hello All,
    I am relatively new to Java programming and I have been given a task that requires me to parse a CSV text file. I have to group the records based on a particular column and then do some math (add columns that have same keys). My problem is that the input file can have nulls and non numeric chars. I am confused how I can proceed in this situation, since I have to add these records, when I do a parseDouble it might fail. OK. I can get around it by assigning a zero in case there is a NumberFormatException but the result of my task is to render an output text file that from the input file. Here comes the catch, the requirement has it, that if the input file had a null or a non numeric char then while rendering the output, I have to populate a code as a place holder for that location where a null or non numeric char was found. I'd like to know if there is any trivial way of getting around this problem without using a Map to remember the location where the null was found. Any help is greatly appreciated. Thanks all in advance.

    maybemedic wrote:
    Mogalr,
    The non numeric chars could be any random chars like aabb,null strings etc.In the past I've made small methods that would just check to see if the string was all characters and decimal point... and check formatting... check that it doesn't have 2 decimal points and after it's trimmed that there aren't any spaces and the length is >0.
    The checking is slower than using like Double.doubleValue(), unless you hit a format exception. So you have to decide what quality of data you have before committing to you're game plan.

  • SAXParseException when trying to parse a text that contains "&"

    Hi all again,
    now I have another problem parsing text...
    When I try to parse the next xml:
    <?xml version="1.0" encoding="UTF-8"?>
    <areastate><identifier>AREA 01&&&hola</identifier>
    <code>1</code>
    <description>Area unica </description>
    <timestamp>1027058590958</timestamp>
    <activestrategy><identifier>ESTR 101</identifier>
    <description>Estrategia 1 del area 1</description>
    </activestrategy>
    <subarea><identifier>SUBA 101_asdfg</identifier>
    <description>Subarea 1 del area 1</description>
    <operationmode><timetable /></operationmode>
    <subareastreet><streetplan><plan>plan 91</plan>
    <forced><no/></forced>
    <ordered>plan 91</ordered>
    </streetplan><streetcycle><cycle>100</cycle>
    <forced><no/></forced>
    <ordered>100</ordered>
    </streetcycle>
    </subareastreet>
    <subareatimetable><plan>plan 91</plan>
    <cycle>100</cycle>
    </subareatimetable>
    <subareaselection><plan>--</plan>
    <cycle></cycle>
    </subareaselection>
    <subareaadaptative><cycle></cycle>
    </subareaadaptative>
    </subarea>
    </areastate>
    I get this exception :
    org.apache.crimson.parser/P-009
    org.xml.sax.SAXParseException: org.apache.crimson.parser/P-009
         at org.apache.crimson.parser.Parser2.fatal(Parser2.java:3035)
         at org.apache.crimson.parser.Parser2.fatal(Parser2.java:3023)
         at org.apache.crimson.parser.Parser2.maybeReferenceInContent(Parser2.java:2296)
         at org.apache.crimson.parser.Parser2.content(Parser2.java:1754)
         at org.apache.crimson.parser.Parser2.maybeElement(Parser2.java:1468)
         at org.apache.crimson.parser.Parser2.content(Parser2.java:1700)
         at org.apache.crimson.parser.Parser2.maybeElement(Parser2.java:1468)
         at org.apache.crimson.parser.Parser2.parseInternal(Parser2.java:499)
         at org.apache.crimson.parser.Parser2.parse(Parser2.java:304)
         at org.apache.crimson.parser.XMLReaderImpl.parse(XMLReaderImpl.java:433)
         at com.saincotrafico.optimus.client.gui.realtime.XMLListener.creaObjeto(XMLListener.java:109)
         at com.saincotrafico.optimus.client.gui.realtime.XMLListener.onMessage(XMLListener.java:63)
         at org.jboss.mq.SpyMessageConsumer.run(SpyMessageConsumer.java:490)
         at java.lang.Thread.run(Thread.java:484)
    I've noticed that this only happens if one of the values between to tags have an '&'.
    Any ideas? Please it's VERY IMPORTANT as one client of ours has deicided to change identifier of the areas ant put some &&&s in the name. The client, my boss, an more people is hasten on me, and I have now no more ideas.

    You mean that I cannot parse something like
    <id>Daniel&Cia.</id>?
    If that's true I think I'm in a big problem...yes.
    but you can change to use CDATA.
    <![CDATA[<hello> &&&&&&&&&&&&&&&& </hello>]]>
    or change to
    <id>Daniel&#38;Cia.<id>

  • Parser loading text outside of tags

    I want to load the data "1280" inside the <POICat> tags in the example below:
    <PlaceAttraction>
    <POICatList>
    <POICat>1280</POICat>
    </POICatList> This text here is a problem.
    </PlaceAttraction>
    Trailing text after </POICatList> "This text here is a problem." also gets loaded when i apply the following xsl stylesheet:
    <?xml version="1.0" encoding="UTF-8"?>
    <INSERT xsl:version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format">
    <!-- Load Category_List -->
    <ROWSET table="STG_POI_CATEGORY_LIST">
    <xsl:for-each select="//POICatList/POICat">
    <ROW>
    <CATEGORY><xsl:value-of select="."/></CATEGORY>
    </ROW>
    </xsl:for-each>
    </ROWSET>
    </INSERT>
    Does anyone know why? Your help would be greatly appreciated. I'm using oracle parser version 2.
    Thanks.
    null

    <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by Steven Muench ([email protected]):
    I tried ORAXSL from the command line (both version 2.0.2.9 and version 9.0.0) and I don't get the extra text in the transformed result.
    Do you see it if you try oraxsl from the command line?<HR></BLOCKQUOTE>
    no, that works fine, but it doesn't support multiple table handling. I'm using oracle.xml.parser.v2.XSLStylesheet, org.w3c.dom.Document and oracle.xml.sql.dml.OracleXMLSave. I don't know what is causing the problem. I'm really pressed for time, so i decided to use oraxsl and OracleXML putXML and use a stylesheet for each table. that works great.
    Another question. i have to call oraxsl with its full qualifying name: oracle.xml.parser.v2.oraxsl for it to work and i have my classpath set right. Do you know why?
    Thanks for taking the time to help.
    Luis.
    null

  • How to parse a text file and produce a dynamic shell script for linking?

    I have some mapping files, one example is like this one;
    $ cat CON_xfrm_contract_to_20080302.map
    (object mfile_c_type
    (path "file:OBSOLETE")
    (fs "file://amanos/s01/abinitio/data/prod/mfs/mfs_16way")
    (local_paths 16
      "file://amanos/s01/abinitio/data/prod/mfs/parts/mfs_16way_001/mfs_16way/Applications/RDS/CON_PUB/main/CON_xfrm_contract_to_20080302.dat"
      "file://amanos/s01/abinitio/data/prod/mfs/parts/mfs_16way_002/mfs_16way/Applications/RDS/CON_PUB/main/CON_xfrm_contract_to_20080302.dat"
      "file://amanos/s01/abinitio/data/prod/mfs/parts/mfs_16way_003/mfs_16way/Applications/RDS/CON_PUB/main/CON_xfrm_contract_to_20080302.dat"
      "file://amanos/s01/abinitio/data/prod/mfs/parts/mfs_16way_004/mfs_16way/Applications/RDS/CON_PUB/main/CON_xfrm_contract_to_20080302.dat"
      "file://amanos/s01/abinitio/data/prod/mfs/parts/mfs_16way_005/mfs_16way/Applications/RDS/CON_PUB/main/CON_xfrm_contract_to_20080302.dat"
      "file://amanos/s01/abinitio/data/prod/mfs/parts/mfs_16way_006/mfs_16way/Applications/RDS/CON_PUB/main/CON_xfrm_contract_to_20080302.dat"
      "file://amanos/s01/abinitio/data/prod/mfs/parts/mfs_16way_007/mfs_16way/Applications/RDS/CON_PUB/main/CON_xfrm_contract_to_20080302.dat"
      "file://amanos/s01/abinitio/data/prod/mfs/parts/mfs_16way_008/mfs_16way/Applications/RDS/CON_PUB/main/CON_xfrm_contract_to_20080302.dat"
      "file://amanos/s01/abinitio/data/prod/mfs/parts/mfs_16way_009/mfs_16way/Applications/RDS/CON_PUB/main/CON_xfrm_contract_to_20080302.dat"
      "file://amanos/s01/abinitio/data/prod/mfs/parts/mfs_16way_010/mfs_16way/Applications/RDS/CON_PUB/main/CON_xfrm_contract_to_20080302.dat"
      "file://amanos/s01/abinitio/data/prod/mfs/parts/mfs_16way_011/mfs_16way/Applications/RDS/CON_PUB/main/CON_xfrm_contract_to_20080302.dat"
      "file://amanos/s01/abinitio/data/prod/mfs/parts/mfs_16way_012/mfs_16way/Applications/RDS/CON_PUB/main/CON_xfrm_contract_to_20080302.dat"
      "file://amanos/s01/abinitio/data/prod/mfs/parts/mfs_16way_013/mfs_16way/Applications/RDS/CON_PUB/main/CON_xfrm_contract_to_20080302.dat"
      "file://amanos/s01/abinitio/data/prod/mfs/parts/mfs_16way_014/mfs_16way/Applications/RDS/CON_PUB/main/CON_xfrm_contract_to_20080302.dat"
      "file://amanos/s01/abinitio/data/prod/mfs/parts/mfs_16way_015/mfs_16way/Applications/RDS/CON_PUB/main/CON_xfrm_contract_to_20080302.dat"
      "file://amanos/s01/abinitio/data/prod/mfs/parts/mfs_16way_016/mfs_16way/Applications/RDS/CON_PUB/main/CON_xfrm_contract_to_20080302.dat"))In this file's content I have some exracted text files with same names under different folders;
    $ ls -lt /s01/abinitio/data/prod/mfs/parts/mfs_16way_*/mfs_16way/Applications/RDS/CON_PUB/main/CON_xfrm_contract_to_20080302.dat   [
    -rw-rw-rw-   1 ab_live  abinitio 438652105 Mar  3 01:42 /s01/abinitio/data/prod/mfs/parts/mfs_16way_010/mfs_16way/Applications/RDS/CON_PUB/main/CON_xfrm_contract_to_20080302.dat
    -rw-rw-rw-   1 ab_live  abinitio 438490410 Mar  3 01:42 /s01/abinitio/data/prod/mfs/parts/mfs_16way_016/mfs_16way/Applications/RDS/CON_PUB/main/CON_xfrm_contract_to_20080302.dat
    -rw-rw-rw-   1 ab_live  abinitio 438219252 Mar  3 01:42 /s01/abinitio/data/prod/mfs/parts/mfs_16way_007/mfs_16way/Applications/RDS/CON_PUB/main/CON_xfrm_contract_to_20080302.dat
    -rw-rw-rw-   1 ab_live  abinitio 438521432 Mar  3 01:42 /s01/abinitio/data/prod/mfs/parts/mfs_16way_014/mfs_16way/Applications/RDS/CON_PUB/main/CON_xfrm_contract_to_20080302.dat
    -rw-rw-rw-   1 ab_live  abinitio 438488130 Mar  3 01:42 /s01/abinitio/data/prod/mfs/parts/mfs_16way_003/mfs_16way/Applications/RDS/CON_PUB/main/CON_xfrm_contract_to_20080302.dat
    -rw-rw-rw-   1 ab_live  abinitio 438249547 Mar  3 01:42 /s01/abinitio/data/prod/mfs/parts/mfs_16way_002/mfs_16way/Applications/RDS/CON_PUB/main/CON_xfrm_contract_to_20080302.dat
    -rw-rw-rw-   1 ab_live  abinitio 438312177 Mar  3 01:42 /s01/abinitio/data/prod/mfs/parts/mfs_16way_012/mfs_16way/Applications/RDS/CON_PUB/main/CON_xfrm_contract_to_20080302.dat
    -rw-rw-rw-   1 ab_live  abinitio 439074566 Mar  3 01:42 /s01/abinitio/data/prod/mfs/parts/mfs_16way_015/mfs_16way/Applications/RDS/CON_PUB/main/CON_xfrm_contract_to_20080302.dat
    -rw-rw-rw-   1 ab_live  abinitio 438722261 Mar  3 01:42 /s01/abinitio/data/prod/mfs/parts/mfs_16way_004/mfs_16way/Applications/RDS/CON_PUB/main/CON_xfrm_contract_to_20080302.dat
    -rw-rw-rw-   1 ab_live  abinitio 438742477 Mar  3 01:42 /s01/abinitio/data/prod/mfs/parts/mfs_16way_001/mfs_16way/Applications/RDS/CON_PUB/main/CON_xfrm_contract_to_20080302.dat
    -rw-rw-rw-   1 ab_live  abinitio 438517268 Mar  3 01:42 /s01/abinitio/data/prod/mfs/parts/mfs_16way_008/mfs_16way/Applications/RDS/CON_PUB/main/CON_xfrm_contract_to_20080302.dat
    -rw-rw-rw-   1 ab_live  abinitio 438645835 Mar  3 01:42 /s01/abinitio/data/prod/mfs/parts/mfs_16way_011/mfs_16way/Applications/RDS/CON_PUB/main/CON_xfrm_contract_to_20080302.dat
    -rw-rw-rw-   1 ab_live  abinitio 438334994 Mar  3 01:42 /s01/abinitio/data/prod/mfs/parts/mfs_16way_006/mfs_16way/Applications/RDS/CON_PUB/main/CON_xfrm_contract_to_20080302.dat
    -rw-rw-rw-   1 ab_live  abinitio 438470743 Mar  3 01:42 /s01/abinitio/data/prod/mfs/parts/mfs_16way_005/mfs_16way/Applications/RDS/CON_PUB/main/CON_xfrm_contract_to_20080302.dat
    -rw-rw-rw-   1 ab_live  abinitio 438095853 Mar  3 01:42 /s01/abinitio/data/prod/mfs/parts/mfs_16way_009/mfs_16way/Applications/RDS/CON_PUB/main/CON_xfrm_contract_to_20080302.dat
    -rw-rw-rw-   1 ab_live  abinitio 438434204 Mar  3 01:42 /s01/abinitio/data/prod/mfs/parts/mfs_16way_013/mfs_16way/Applications/RDS/CON_PUB/main/CON_xfrm_contract_to_20080302.datI need a shell script which will produce a shell script from the content of the mapping file so that I can be able to symbolicly link these files with different names and under the same folder, like;
    ln -s /s01/abinitio/data/prod/mfs/parts/mfs_16way_001/mfs_16way/Applications/RDS/CON_PUB/main/CON_xfrm_contract_to_20080302.dat ./mfs_16way_001.CON_xfrm_contract_to_20080302.dat
    ln -s /s01/abinitio/data/prod/mfs/parts/mfs_16way_016/mfs_16way/Applications/RDS/CON_PUB/main/CON_xfrm_contract_to_20080302.dat ./mfs_16way_016.CON_xfrm_contract_to_20080302.datI am a newbie for shell scripting, I tried several awk and sed operations but couldn't get close to this output :(
    If you guide me I will be so glad, thank you.
    ps: amanos is the name of this server.

    this is thepoint that I am stuck, I can not add the destination sym.link name to the end of each line;
    $ grep "  \"file://amanos" CON_xfrm_contract_to_20080302.map | cut -c17- | sed  's/"//;s/)//g' | sed 's/\/s01/ln -s \/s01/g'
    ln -s /s01/abinitio/data/prod/mfs/parts/mfs_16way_001/mfs_16way/Applications/RDS/CON_PUB/main/CON_xfrm_contract_to_20080302.dat
    ln -s /s01/abinitio/data/prod/mfs/parts/mfs_16way_002/mfs_16way/Applications/RDS/CON_PUB/main/CON_xfrm_contract_to_20080302.dat
    ln -s /s01/abinitio/data/prod/mfs/parts/mfs_16way_003/mfs_16way/Applications/RDS/CON_PUB/main/CON_xfrm_contract_to_20080302.dat
    ln -s /s01/abinitio/data/prod/mfs/parts/mfs_16way_004/mfs_16way/Applications/RDS/CON_PUB/main/CON_xfrm_contract_to_20080302.dat
    ln -s /s01/abinitio/data/prod/mfs/parts/mfs_16way_005/mfs_16way/Applications/RDS/CON_PUB/main/CON_xfrm_contract_to_20080302.dat
    ln -s /s01/abinitio/data/prod/mfs/parts/mfs_16way_006/mfs_16way/Applications/RDS/CON_PUB/main/CON_xfrm_contract_to_20080302.dat
    ln -s /s01/abinitio/data/prod/mfs/parts/mfs_16way_007/mfs_16way/Applications/RDS/CON_PUB/main/CON_xfrm_contract_to_20080302.dat
    ln -s /s01/abinitio/data/prod/mfs/parts/mfs_16way_008/mfs_16way/Applications/RDS/CON_PUB/main/CON_xfrm_contract_to_20080302.dat
    ln -s /s01/abinitio/data/prod/mfs/parts/mfs_16way_009/mfs_16way/Applications/RDS/CON_PUB/main/CON_xfrm_contract_to_20080302.dat
    ln -s /s01/abinitio/data/prod/mfs/parts/mfs_16way_010/mfs_16way/Applications/RDS/CON_PUB/main/CON_xfrm_contract_to_20080302.dat
    ln -s /s01/abinitio/data/prod/mfs/parts/mfs_16way_011/mfs_16way/Applications/RDS/CON_PUB/main/CON_xfrm_contract_to_20080302.dat
    ln -s /s01/abinitio/data/prod/mfs/parts/mfs_16way_012/mfs_16way/Applications/RDS/CON_PUB/main/CON_xfrm_contract_to_20080302.dat
    ln -s /s01/abinitio/data/prod/mfs/parts/mfs_16way_013/mfs_16way/Applications/RDS/CON_PUB/main/CON_xfrm_contract_to_20080302.dat
    ln -s /s01/abinitio/data/prod/mfs/parts/mfs_16way_014/mfs_16way/Applications/RDS/CON_PUB/main/CON_xfrm_contract_to_20080302.dat
    ln -s /s01/abinitio/data/prod/mfs/parts/mfs_16way_015/mfs_16way/Applications/RDS/CON_PUB/main/CON_xfrm_contract_to_20080302.dat
    ln -s /s01/abinitio/data/prod/mfs/parts/mfs_16way_016/mfs_16way/Applications/RDS/CON_PUB/main/CON_xfrm_contract_to_20080302.dat
    $ /)//g' | sed 's/\/s01/ln -s \/s01/g' | awk -F\/ '{print $8"."$14}'                                                       <
    mfs_16way_001.CON_xfrm_contract_to_20080302.dat
    mfs_16way_002.CON_xfrm_contract_to_20080302.dat
    mfs_16way_003.CON_xfrm_contract_to_20080302.dat
    mfs_16way_004.CON_xfrm_contract_to_20080302.dat
    mfs_16way_005.CON_xfrm_contract_to_20080302.dat
    mfs_16way_006.CON_xfrm_contract_to_20080302.dat
    mfs_16way_007.CON_xfrm_contract_to_20080302.dat
    mfs_16way_008.CON_xfrm_contract_to_20080302.dat
    mfs_16way_009.CON_xfrm_contract_to_20080302.dat
    mfs_16way_010.CON_xfrm_contract_to_20080302.dat
    mfs_16way_011.CON_xfrm_contract_to_20080302.dat
    mfs_16way_012.CON_xfrm_contract_to_20080302.dat
    mfs_16way_013.CON_xfrm_contract_to_20080302.dat
    mfs_16way_014.CON_xfrm_contract_to_20080302.dat
    mfs_16way_015.CON_xfrm_contract_to_20080302.dat
    mfs_16way_016.CON_xfrm_contract_to_20080302.datMessage was edited by:
    antu
    Message was edited by:
    antu

Maybe you are looking for

  • Problem With Verify Disc Function

    I just found out that I should be using Repair Disc Permissions more often that I have been. So I went to Apps - Utilities - Disc Utilities and clicked on the first line in the list at the left of the window. Then I clicked on Verify Disc Permissions

  • JSP Precompilation

              I have an interesting issue when deploying an EAR file, Weblogic appears to want           to recompile JSP's at first request even though I have included compiled JSP code           in the EAR and have added a couple of suggested parameter

  • Can't Change Mercury Playback Engine

    Everytime I try to change the Mercury Playback Engine from "Software Only" to "GPU Acceleration", I can't. The section to change the Mercury Playback Engine, appears to be grey, like everyone else has been saying. I have read and searched around the

  • Hierarchical trees in forms

    in my oracle forms application i'm working with hierarchical trees; every time the tree displays all the nodes are expanded, but i want all of them to be collapsed, i tried to set the properties of the tree with ftree.collapsed_node, but i only got a

  • Targeting the timeline of a loaded swf - AS2

    I'm loading an external swf into a project and I want to be able to start and stop the loaded swfs timeline at will.... I'm loading swf into an MC: loadMovie("myFile.swf", swfHolder_mc);