Remove whitespace

Thank you for every one for the help
but my probleme still does not resolved, because when i try to use the program with a full content of the file
it does not work. i attach the (Lv1)origal , and (Lv2) i did it manually. and also i attach the progeam
someone can help me with a sample
Thank you
Diallo
Attachments:
files.zip ‏32 KB

nyc wrote:
You'll have to explain more what is wrong with the VI Scott Jordan wrote for you.
Hey! I wrote that VI in "files.zip" 
(http://forums.ni.com/ni/board/message?board.id=170​&message.id=200642#M200642 )
Anyway, my code makes very few differences, e.g. at position 900 you leave a \n in while my code removes it. It is not clear what your specification for the problem are.
Please list your exact requirements. What to remove, what to leave in. So far we can only guess.
LabVIEW Champion . Do more with less code and in less time .

Similar Messages

  • How do I remove whitespace from a template header

    I am trying to work myself thru understanding html coding by using a dreamweaver template and creating a page for my company. I have used dreamweaver before CC, however I am trying to understand the new changes.
    I ran into a problem I am hoping to get help with.
    I tried swapping out a placeholder logo on the template with my own logo. I seem to have a bit of white space at the bottom of the logo when I see it in live view or a browser. How can I get rid of it. I tried combinations of 0 margins and changing padding, but it seems I'm just whistling in the dark. Here is the code:
    The CSS associated with this page is here:
    @charset "UTF-8"; body {   font: 100%/1.4 Verdana, Arial, Helvetica, sans-serif;   background-color: #42413C;   margin: 0;   padding: 0;   color: #000; } /* ~~ Element/tag selectors ~~ */ ul, ol, dl { /* Due to variations between browsers, it's best practices to zero padding and margin on lists. For consistency, you can either specify the amounts you want here, or on the list items (LI, DT, DD) they contain. Remember that what you do here will cascade to the .nav list unless you write a more specific selector. */   padding: 0;   margin: 0; } h1, h2, h3, h4, h5, h6, p {   margin-top: 0; /* removing the top margin gets around an issue where margins can escape from their containing block. The remaining bottom margin will hold it away from any elements that follow. */   padding-right: 15px;   padding-left: 15px; /* adding the padding to the sides of the elements within the blocks, instead of the block elements themselves, gets rid of any box model math. A nested block with side padding can also be used as an alternate method. */ } a img { /* this selector removes the default blue border displayed in some browsers around an image when it is surrounded by a link */   border: none; } /* ~~ Styling for your site's links must remain in this order - including the group of selectors that create the hover effect. ~~ */ a:link {   color: #42413C;   text-decoration: underline; /* unless you style your links to look extremely unique, it's best to provide underlines for quick visual identification */ } a:visited {   color: #6E6C64;   text-decoration: underline; } a:hover, a:active, a:focus { /* this group of selectors will give a keyboard navigator the same hover experience as the person using a mouse. */   text-decoration: none; } /* ~~ This fixed width container surrounds all other blocks ~~ */ .container {   width: 960px;   background-color: #FFFFFF;   margin: 0 auto; /* the auto value on the sides, coupled with the width, centers the layout */ } /* ~~ The header is not given a width. It will extend the full width of your layout. ~~ */ header {   background-color: #A36BE8; } /* ~~ These are the columns for the layout. ~~ 1) Padding is only placed on the top and/or bottom of the block elements. The elements within these blocks have padding on their sides. This saves you from any "box model math". Keep in mind, if you add any side padding or border to the block itself, it will be added to the width you define to create the *total* width. You may also choose to remove the padding on the element in the block element and place a second block element within it with no width and the padding necessary for your design. 2) No margin has been given to the columns since they are all floated. If you must add margin, avoid placing it on the side you're floating toward (for example: a right margin on a block set to float right). Many times, padding can be used instead. For blocks where this rule must be broken, you should add a "display:inline" declaration to the block element's rule to tame a bug where some versions of Internet Explorer double the margin. 3) Since classes can be used multiple times in a document (and an element can also have multiple classes applied), the columns have been assigned class names instead of IDs. For example, two sidebar blocks could be stacked if necessary. These can very easily be changed to IDs if that's your preference, as long as you'll only be using them once per document. 4) If you prefer your nav on the left instead of the right, simply float these columns the opposite direction (all left instead of all right) and they'll render in reverse order. There's no need to move the blocks around in the HTML source. */ .sidebar1 {   float: right;   width: 180px;   background-color: #C5C2B8;   padding-bottom: 10px; } .content {   padding: 10px 0;   width: 780px;   float: right; } /* ~~ This grouped selector gives the lists in the .content area space ~~ */ .content ul, .content ol {   padding: 0 15px 15px 40px; /* this padding mirrors the right padding in the headings and paragraph rule above. Padding was placed on the bottom for space between other elements on the lists and on the left to create the indention. These may be adjusted as you wish. */ } /* ~~ The navigation list styles (can be removed if you choose to use a premade flyout menu like Spry) ~~ */ nav ul{   list-style: none; /* this removes the list marker */   border-top: 1px solid #666; /* this creates the top border for the links - all others are placed using a bottom border on the LI */   margin-bottom: 15px; /* this creates the space between the navigation on the content below */ } nav li {   border-bottom: 1px solid #666; /* this creates the button separation */ } nav a, nav a:visited { /* grouping these selectors makes sure that your links retain their button look even after being visited */   padding: 5px 5px 5px 15px;   display: block; /* this gives the link block properties causing it to fill the whole LI containing it. This causes the entire area to react to a mouse click. */   width: 160px;  /*this width makes the entire button clickable for IE6. If you don't need to support IE6, it can be removed. Calculate the proper width by subtracting the padding on this link from the width of your sidebar container. */   text-decoration: none;   background-color: #15EE00; } nav a:hover, nav a:active, nav a:focus { /* this changes the background and text color for both mouse and keyboard navigators */   background-color: #ADB96E;   color: #FFF; } /* ~~ The footer ~~ */ footer {   padding: 10px 0;   background-color: #CCC49F;   position: relative;/* this gives IE6 hasLayout to properly clear */   clear: both; /* this clear property forces the .container to understand where the columns end and contain them */ } /*HTML 5 support - Sets new HTML 5 tags to display:block so browsers know how to render the tags properly. */ header, section, footer, aside, article, figure {   display: block; } 
    Thank you for your help!

    Try this -
    <img src="assets/jpgs/Prodigy Logo Large 2014.jpg" width="180" height="180" alt="" style="display:block;">
    What you are seeing as whitespace is the space reserved for glyph descenders on any element that is rendered within a text box (i.e., an inline element). By making the image "display:block" you eliminate that space because a block element doesn't have descenders. If that works to your satisfaction then you can give the logo an id, and create a CSS selector containing that block style.

  • Why does a find and replace method remove whitespace?

    I have method that searches for a string in a FM document and replaces it with a variable. If for example, there was a string foobar that I wanted to replace with the variable barfoo. Then, I expect this text:
    Lorem ipsum dolor sit amet, foobar consectetur adipiscing elit. Vivamus sed purus urna, ac tristique tortor. Nam auctor tellus non enim pulvinar a vestibulum neque tincidunt.
    To be changed to this text:
    Lorem ipsum dolor sit amet, barfoo consectetur adipiscing elit. Vivamus sed purus urna, ac tristique tortor. Nam auctor tellus non enim pulvinar a vestibulum neque tincidunt.
    However, while the text does do the replace it also removes the whitespace between the variable and the text that appears right after the variable so it actually looks looks like this:
    Lorem ipsum dolor sit amet, barfooconsectetur adipiscing elit. Vivamus sed purus urna, ac tristique tortor. Nam auctor tellus non enim pulvinar a vestibulum neque tincidunt.
    Why is the find and replace method removing the whitespace and how do I prevent that from happening? The method is provided below.
    function FindAndReplaceString(pDoc, findString, replaceVariable)
        if (typeof pDoc != 'undefined'&&typeof findString != 'undefined'&&typeof replaceVariable != 'undefined'&&pDoc.ObjectValid()&&findString.length>0&&replaceVariable.length>0)
            var vVarFmtStatus=checkVarFmStatus (pDoc, replaceVariable);
            if (vVarFmtStatus=='In Doc')
                var tr = new TextRange();
                var findParams = new PropVals();
                var frame = pDoc.MainFlowInDoc.FirstTextFrameInFlow;
                var restoreTR = pDoc.TextSelection;
                tr.beg.obj = tr.end.obj = frame.FirstPgf;
                tr.beg.offset = tr.end.offset = 0;
                findParams = AllocatePropVals(1);
                findParams[0].propIdent.num = Constants.FS_FindText;
                findParams[0].propVal.valType = Constants.FT_String;
                findParams[0].propVal.sval = findString;
                tr = pDoc.Find(tr.beg, findParams);
                var vLoopCounter=0;
                while(FA_errno === Constants.FE_Success&&vLoopCounter++< 1000)
                    pDoc.TextSelection = tr;
                    pDoc.Clear(0);
                    var newVar = pDoc.NewAnchoredFormattedVar(replaceVariable, tr.beg);
                    var varLength = newVar.TextRange.end.offset - newVar.TextRange.beg.offset;
                    tr.beg.offset += varLength;
                    tr = pDoc.Find(tr.beg, findParams);
                if (vLoopCounter>0)
                    Log (vLogFileName, 'In the document \''+pDoc.Name+'\', the string \''+findString+'\' was replaced with the variable \''+replaceVariable+'\' '+vLoopCounter+' times.\n')
                if (vLoopCounter>1000)
                    recordErrors (vErrorLog, 'ERROR: In the document "'+pDoc.Name+'", the find and replace operation was stopped after executing '+vLoopCounter+' times. The term being searched for is "'+findString+'" the replacement variable is "'+ replaceVariable+'".')
                pDoc.TextSelection = restoreTR;
                pDoc.ScrollToText(restoreTR);
                } else {
                    recordErrors (vErrorLog, 'ERROR: The find and replace operation failed because the variable '+replaceVariable+' does not exist in the following doc: '+pDoc.Name)
            } else {
                recordErrors (vErrorLog,'Invalid or unitialized parameter passed to function FindAndReplaceString')

    Hi,
    Not at the moment. Please post in http://forums.adobe.com/community/muse/ideas so other users can vote on the feature request.
    Thanks,
    Abhishek

  • Parsing CF tags - how to remove whitespace?

    I have an index.cfm in which I include additional CFM pages.
    index.cfm:
    </head>
    <cfinclude template="first.cfm">
    <cfinclude template="second.cfm">
    <cfinclude template="third.cfm">
    <cfinclude template="forth.cfm">
    <body>
    After executing the file:
    </head>
    <body>
    How can I remove these whitespace? For example first.cfm
    contains the following rows:
    <cfif isDefined("cookie.myCookie")>
    <cfif cookie.ZulzBeta neq "1234">
    <cflocation url="
    http://mypage">
    </cfif>
    </cfif>
    <cfif not isDefined("cookie.myCookie")>
    <cflocation url="
    http://mypage">
    </cfif>
    I know that using <cfscript> this problem won't happen
    but there are a lot of things that I'm not able to do with
    <cfscript>. What should I do?

    <cfprocessingdirective suppressWhiteSpace = "Yes">
    <cfinclude template="first.cfm">
    <cfinclude template="second.cfm">
    <cfinclude template="third.cfm">
    <cfinclude template="forth.cfm">
    <cfprocessingdirective suppressWhiteSpace = "No">
    <!--- Code for the rest of the page --->
    </cfprocessingdirective>
    </cfprocessingdirective>

  • Removing whitespaces and weird characters

    Hi,
    I need a way to remove the whitespaces and punctuation marks from a String.
    So for example,
    "This is a cool racecar!, right?"
    should be read as
    "thisisacoolracecarright"
    After googling for a while, I think I can use a split() method or a BufferedReader, but I don't know how to proceed. Can anyone point me in the right direction?
    This is part of my homework, so I really don't want you to solve it for me, but just help me look in the API or type in a sample code.
    Help would be greatly appreciated.
    -Rommel.
    PS: 10 duke starts to be awarded.
    Edited by: RommelTJ on Sep 15, 2008 9:52 PM

    Sorry for the super late reply, but I couldn't forget to come back and award the Duke Stars.
    Ravi_Gupta wrote:
    while (!inputWord.isEmpty())Always true because you are not modifying the inputWork.
    Try something like this:
    for(int i=0;i<inputWord.length(); i++)
    ch = inputWord.charAt(i);
    if (ch>='A' && ch<='Z' || ch>='a' && ch<='z'){
    } //end if statement.
    } //end while statement.
    This is what I ended up doing:               System.out.println("Please type a word, sentence, or phrase to be checked:");
                  inputWord = StdIn.readLine();                               //records the word inputted(?) by the user.
                  inputWord = inputWord.toLowerCase();                     //converts the 'inputWord' to all Lower Case
                  for(int i=0;i<inputWord.length(); i++) {                //removes punctuation marks
                       char ch = inputWord.charAt(i);          
                       if (ch>='A' && ch<='Z' || ch>='a' && ch<='z'){      //checks if character is in the alphabet
                           shortWord += ch;                                //and if it is, it concatenates it to 'shortWord'
                       }                                                             //end if statement.
                   }                                                                  //end for statement.
                  System.out.println(); I'll give 8 Stars to Ravi_Gupta and 2 Stars to Flounder.

  • How to removing whitespace in jsp

    hi,
    i am loading a jsp file, which had some space at the beginning. i want remove the space, then i need ot parse the data, just like ignoreWhiteSpace in xml. can anybody help on this.
    thanks
    ayathas

    Actually straight replacement will not work because it converts data to string because variables are expected.
    So there are at least two ways to deal with it:
    1. You can create a fake (unused) variable in JSP that prepends URL query - this way all the chars before will not interfere with reading variable:
      fake=fake&username=test&password=xxxxxxxx&result=true"
    2. In your complete handler you can read variables in a loop and hold them in a separate object:
    function completeHandler(e:Event):void
         var varObject:Object = {};
         for (var prop:String in e.target.data)
              trace(prop.replace(/^\W+/, ""), e.target.data[prop]);
              varObject[prop.replace(/^\W+/, "")] = e.target.data[prop];
         trace(varObject.password);

  • How to remove whitespace in deamweaver in design view?

    m having this issue which is driving me crazy. when am looking at my code in design view in Dreamweaver, there is a space below my nav bar like this..... I do not understand how to get rid it?
    but it doent show in live view or the browser..... Edit fiddle - JSFiddle

    Don't expect much from Design view, it's merely a vague approximation.
    Trust your Browser preview.

  • Trying to remove whitespace from a string

    Lets say I have the string "A man a plan a canal Panama"
    How would I turn that into AmanaplanacanalPanama" ?
    I've read a little about 'string buffer' but the teacher hasn't taught us how to use that yet (hasn't taught us much of anything). Is there any way to do this withough using a string buffer?
    I'm making a palindrom tester, and I'm almost finished, but I can't seem to deal with these white spaces. Please help.

    I'd do it using String's replaceAll method, to replace all occurences of space, or of one or more spaces, with the empty string "", but I don't know if you're supposed to use that or roll your own with brute force.
    The brute force way would be to do something like this: Allocate a char array as big as the sentence.
    for each char in the sentence (using String.charAt) {
        if it is not a space {
            add it to the array
            increment the number of non-space characters counter
    Use whatever char array methods String has to build a new String from the
    first N chars of the array, where N is the number of non-space chars.

  • Trim filter for iPlanet - whitespace removing from html

    Hi,
    I've just published my Trim Filter NSAPI plugin for Sun One Web Server/iPlanet
    It is a plugin/filter which removes whitespaces from HTML code. Its LGPL and it can be found here: http://www.thrull.com/iplanet/
    Feel free to test it :-)
    BR,
    Igor

    Cool, thanks for sharing it!
    I took a quick look, and I think I spotted a bug in the write filter method:        /* workaround for a bug? in iPlanet, when returning empty content */
            if (!out_size && amount) {
                rv = net_write(layer->lower, NON_EMPTY_STRING, 1);
                out_size = 1;
            } else {
                rv = net_write(layer->lower, (const char *)buffer, out_size);
            return rv;According to the NSAPI Programmer's Guide (http://docs.sun.com/source/817-6252/npgnsapi.html#wp1004627), the write filter method should return the number of bytes consumed on success. It looks like your write filter method is returning the number of bytes written instead. Perhaps that's the reason you needed that work around?

  • Is there better way to do this?  (Xml Pretty Print | node removing)

    Hi all, I have been working at home on a small project to help my Java Jedi training. :-)
    My app saves quotes from authors in an xml file.
    I have a class [XmlRepository extends Thread] that holds control of an xml file to handle requests for Nodes.
    When I remove a node I get a Line Space above the node that was removed, or better put my node gets replaced by a empty line.
    Pretty print or correct Node removing.
    part of my xml is like this (I have resumed it for readability):
        <entities forUser="ffffffff-ffff-ffff-ffff-ffffffffffff">
            <quotes/>
            <authors>
                <author id="f156c570-c676-4d69-9b15-ae7d859ff771" languageCode="en" regenerateAs="com.fdt.cognoscere.entities.sources.Author">
                    <lastNames>Poe</lastNames>
                    <firstNames>Edgar Allan</firstNames>
                </author>
                <author id="35dc0c5a-3813-4a10-af49-8d4ea1c2cee0" languageCode="en" regenerateAs="com.fdt.cognoscere.entities.sources.Author">
                    <lastNames>Wilde</lastNames>
                    <firstNames>Oscar</firstNames>
                </author>
                <author id="317f72ea-add6-4bd2-8c63-d8b373a830ab" languageCode="en" regenerateAs="com.fdt.cognoscere.entities.sources.Author">
                    <lastNames>Christie</lastNames>
                    <firstNames>Agatha</firstNames>
                </author>
                <author id="28047c89-b647-4c40-b6c7-677feaf2dfda" languageCode="en" regenerateAs="com.fdt.cognoscere.entities.sources.Author">
                    <lastNames>Shakespeare</lastNames>
                    <firstNames>William</firstNames>
                </author>
            </authors>
        </entities>If I remove A Node ( Edgar Allan Poe (1st in this case)) the resulting Xml when saved is like this (I have added the space indentation just as it is outputted by my code):
        <entities forUser="ffffffff-ffff-ffff-ffff-ffffffffffff">
            <quotes/>
                <author id="35dc0c5a-3813-4a10-af49-8d4ea1c2cee0" languageCode="en" regenerateAs="com.fdt.cognoscere.entities.sources.Author">
                    <lastNames>Wilde</lastNames>
                    <firstNames>Oscar</firstNames>
                </author>
                <author id="317f72ea-add6-4bd2-8c63-d8b373a830ab" languageCode="en" regenerateAs="com.fdt.cognoscere.entities.sources.Author">
                    <lastNames>Christie</lastNames>
                    <firstNames>Agatha</firstNames>
                </author>
                <author id="28047c89-b647-4c40-b6c7-677feaf2dfda" languageCode="en" regenerateAs="com.fdt.cognoscere.entities.sources.Author">
                    <lastNames>Shakespeare</lastNames>
                    <firstNames>William</firstNames>
                </author>
            </authors>
        </entities>this is how I initialize the XML DOM Handlers, and the method for removing a Node:
         * Initializes factory instances and member variables.
        private void initialize() {
            //obtain an instance of a documentFactory create a document documentBuilder
            this.documentFactory = DocumentBuilderFactory.newInstance();
            //Configure the documentFactory to be name-space aware and validate trough an xsd file
            this.documentFactory.setNamespaceAware(true);
            this.documentFactory.setValidating(true);
            this.documentFactory.setAttribute(JAXP_SCHEMA_LANGUAGE, W3C_XML_SCHEMA);
            try {
                //obtain an instance of an XPathFactory
                this.xpathFactory = XPathFactory.newInstance(XPathFactory.DEFAULT_OBJECT_MODEL_URI);
                //obtain an instance of the xpath evaluator object
                this.xpathEvaluator = this.xpathFactory.newXPath();
                //set namespace mapping configurations
                NamespaceContextMap namespaceMappings = new NamespaceContextMap();
                namespaceMappings.put("xml", "http://www.w3.org/XML/1998/namespace");
                namespaceMappings.put("xmlns", "http://www.w3.org/2000/xmlns/");
                namespaceMappings.put("xsd", "http://www.w3.org/2001/XMLSchema");
                namespaceMappings.put("xsi", "http://www.w3.org/2001/XMLSchema-instance");
                namespaceMappings.put(this.schemaNamespaceMapping, this.schemaNamespace);
                //add mappings
                this.xpathEvaluator.setNamespaceContext(namespaceMappings);
            } catch (XPathFactoryConfigurationException ex) {
                Logger.getLogger(XmlRepository.class.getName()).log(Level.SEVERE, null, ex);
            try {
                //obtain a trasformer factory to save the file
                this.transformerFactory = TransformerFactory.newInstance();
                this.transformerFactory.setAttribute("indent-number", 4);
                //obtain the transforme
                this.transformer = this.transformerFactory.newTransformer();
                //setup transformer
                this.transformer.setOutputProperty(OutputKeys.METHOD, "xml");
                this.transformer.setOutputProperty(OutputKeys.INDENT, "yes");
                this.transformer.setOutputProperty(OutputKeys.MEDIA_TYPE, "text");
                this.transformer.setOutputProperty("{http://xml.apache.org/xslt}indent-amount", "4");
            } catch (TransformerConfigurationException tcex) {
                Logger.getLogger(XmlRepository.class.getName()).log(Level.SEVERE, null, tcex);
         * Removes a node by evaluating the XPATH expression.
         * @param xpath A String instance with the XPATH expression representing the element to remove.
         * @throws com.fdt.cognoscere.storage.exceptions.UnableToRemoveException When an exception occurs that prevents the repository to execute the remove statement.
        public void removeNode(final String xpath) throws UnableToRemoveException {
            Node nodeToRemove = null;
            Node parentNode = null;
            //verify xpath
            if (xpath == null)
                throw new IllegalArgumentException("The xpath argument cannot be null.");
            //verify that the repository is loaded
            if (!this.loaded)
                throw new IllegalStateException("The XmlRepository faild to load properly and it is in an invalid state. It cannot perfom any operation.");
            try {
                //get the node to remove out of the xpath expression
                nodeToRemove = this.getNode(xpath);
                //throw an exception if no node was found to remove
                if (nodeToRemove == null)
                    throw new UnableToFindException("The node element trying to be remove does not exist.");
                //obtain the parent node to remove its child
                parentNode = nodeToRemove.getParentNode();
                //remove the node from the parent node
                nodeToRemove = parentNode.removeChild(nodeToRemove);
            } catch.......removed to save space{
            } finally {
                //normalize document
                this.document.normalize();
        }Please tell me if I could do this better,
    thanks,
    f(t)

    franciscodiaztrepat wrote:
    When I remove a node I get a Line Space above the node that was removed, or better put my node gets replaced by a empty line.Replaced? No, there's already a new-line character after the node that was removed. And there was one before that node too. You didn't remove either of those, so after the removal there are two consecutive new-line characters. As you can see.
    And no, trying to pretty-print the XML document won't remove any of those. It might add whitespace to make the document nicely indented, but it won't ever remove whitespace. If you want whitespace removed then you'll have to do it yourself.
    For example, after you remove a node, also remove the node following it if it's a whitespace text node. Or something like that.

  • Parse XML file, read a tag with whitespaces value.

    Hi all,
    I've got a problem with reading a spaced value record from xml file using sys.xmltype.
    My xml file contains the following:
    <?xml version = '1.0'?>;
    <ROWSET>
    <ROW num="1">
    <FIRSTNAME>Nik</FIRSTNAME>
    <LASTNAME> </LASTNAME>
    <AGE>30</AGE>
    </ROW>
    </ROWSET>
    As you see last name contains four spaces!
    Now when I'm trying to read value from LASTNAME record I'm getting a NULL value, but I want it to return me those 4 spaces as they are.
    Here is a short code description of what I'm doing:
    declare
         xml sys.xmltype;
    str1 varchar2(100);
    str2 varchar2(100);
    begin
         xml := sys.xmltype.createxml(fileContentClob); -- I copy the file content into the fileContentClob variable.
         If xml.existsnode('//ROW['1']/LASTNAME') > 0 Then -- This condition evaluates as true
    str1 := xml.extract('//ROW['1']/LASTNAME/text()'); -- str1 gets NULL value :(, I want spaces as they are in the file.
    str2 := xml.extract('//ROW[' || 1 || ']/LASTNAME').getstringval; -- str2 gets <LASTNAME/> null tag :(.
         End If;     
    end;
    Seems like when it createxml from the fileContentClob it ignores the spaces and find LASTNAME as a null field.
    Do you have any suggestions on how can I fix that, so I can read whitespaces as they are in the file?
    I generate the file also using a xml toolpackage from oracle:
    declare
    strSqlStmt Varchar2(300);
    varCtxHdl dbms_xmlquery.ctxhandle;
    varClob Clob;
    begin
    strSqlStmt := 'SELECT FIRSTNAME,LASTNAME,AGE FROM USERS WHERE ROWNUM =1';
    varCtxHdl := dbms_xmlquery.newcontext(strSqlStmt);
    varClob := dbms_xmlquery.getxml(varCtxHdl);
    dbms_xmlquery.closecontext(varCtxHdl);
    End;

    Even if the STORE AS CLOB clause is used to store the data and preserve whitespace for the XML, the actual extraction of data seems to be removing whitespace...
    SQL> ed
    Wrote file afiedt.buf
      1* create table t (xml xmltype) xmltype xml store as clob
    SQL> /
    Table created.
    SQL> ed
    Wrote file afiedt.buf
      1  insert into t (xml)
      2  values (q'[<?xml version = '1.0'?>
      3  <ROWSET>
      4  <ROW num="1">
      5  <FIRSTNAME>Nik</FIRSTNAME>
      6  <LASTNAME>    </LASTNAME>
      7  <AGE>30</AGE>
      8  </ROW>
      9* </ROWSET>]')
    SQL> /
    1 row created.
    SQL> select * from t;
    XML
    <?xml version = '1.0'?>
    <ROWSET>
    <ROW num="1">
    <FIRSTNAME>Nik</FIRSTNAME>
    <LASTNAME>    </LASTNAME>
    <AGE>30</AGE>
    </ROW>
    </ROWSET>
    SQL> set null NULL
    SQL> select x.rnum, x.firstname, x.lastname, x.age
      2  from t
      3      ,xmltable('/ROWSET/ROW'
      4                PASSING t.xml
      5                COLUMNS rnum      NUMBER       PATH '/ROW/@num'
      6                       ,firstname VARCHAR2(10) PATH '/ROW/FIRSTNAME'
      7                       ,lastname  VARCHAR2(10) PATH '/ROW/LASTNAME'
      8                       ,age       NUMBER       PATH '/ROW/AGE'
      9               ) x
    10  /
          RNUM FIRSTNAME  LASTNAME          AGE
             1 Nik        NULL               30
    SQL>

  • Issue with Extra Whitespace in Public Tidal Variable

    Hi All,
    I'm currently having an issue using a public Tidal variable in the file path of a ROBOCOPY script that I'm writing.
    We are running version 6.0.3.209
    Here is the scenario where I'm having the failure;
    1) I created a SQL job to pull a static string value from a databases (the SQL trims the string value to remove whitespaces from left and right)
    2) I created a public string variable, a variable event, and a job event
    3) When the SQL job completes, it triggers a job event which triggers the variable event and sets the public string variable to the output of the SQL job
    The variable should be set to this value with no whitespaces: 20130702170530_Q2
    4) I then pass this variable in the file path of my ROBOCOPY script, and the script fails
    Steps 1-3 work just fine, HOWEVER, my script is failing in ALL scenarios EXCEPT hard-coding the value.
    What's even stranger is that before I double click and open the variable, you can obviously see that there IS a whitespace (see top arrow in below img)
    If I run my ROBOCOPY script using the variable like this, it Completes Abnormally (Failed)
    When I double click to open the variable, without any modifications you can see that there is NO whitespace (see lower arrow in above img).
    If I click ‘OK’ after Opening the variable without modifying it, the whitespace disappears (see arrow in img below).
    Now if I run the exact same ROBOCOPY script using the exact same variable, it Completes Normally (Passed)
    Does anyone know a workaround for this or has anyone experienced the same behavior?
    I have tried multiple scenarios (passing the job output directly, passing the variable, concatenating 2 variables in to 1 and passing the entire folder path as a variable) and all are failing.
    Any help would be greatly appreciated!
    Best Regards,
    Doug M.

    Hi All,
    I was actually able to find a workaround for this not using Tidal variables.  I ended up hard coding part of the file path in the SQL job which pulls the static string value, and concatenating the 2 strings like this:
    SELECT TOP 1 'E:\data\inbound\KMK\RETROACTIVE\' + LTRIM(RTRIM([Data_Date]))
    FROM [DB_NAME].[dbo].[TABLE_NAME]
    WHERE = 946
    When I pass the job output to my ROBOCOPY script it works perfectly.
    I'll leave this as answered instead of deleting it in case anyone has the same issue

  • PCC-F-02044, CMD-LINE:  Illegal or out of range value for option

    Good day,
    I very new to Pro*C and its compiler, i was tasked to recompile a program from a previous developer and got stuck with the above mentioned problem.
    The command i'm using to compile the program is: proc xxx.pc
    This returns the illegal or out of range value error
    #include <iostream>
    #include <fstream>
    #include <string>
    #include <stdio.h>
    #include <sqlda.h>
    #include <sqlcpr.h>
    #include <sqlca.h>
    #include <stddef.h>
    using namespace std;
      char myfile[60];     
      char puk [][];
      int last_col = 0;
      int last_row = 0;
      int line_nr = 0;
      string line = ""; 
    int main(int argc, char *argv[])
        if (argc != 2)
           return(1);
      ifstream myfile;
      myfile.open (argv[1],ios::in);
      if (myfile.is_open())
        while (! myfile.eof() )
        //while(getline(myfile,line))
          getline (myfile,line);
          line_nr++; //counting number of lines
          line = trim(line); //remove whitespaces
          if (line == "\r" or line.length()  == 0) {
             continue;  //ignore blank lines
           if (line_nr == 1) {        
              last_col = 1;
              last_row = 0;
              puk [last_row][last_col] = line;          
           } else if (line_nr > 1 && line.substr(1,3) != 'OOF') {          
              last_col = last_col + 1;
              puk [last_row][last_col] = line;          
           } else {     
             last_row = last_row + 1;
              puk [last_row][1] = line;                    
        myfile.close();
        line_nr = 0;
      return 0;
             Any assistance will be appreciated.
    Regards,

    My pcscfg.cfg file is set as follows:
    sys_include=(/usr/include/c++/4.1.1/iostream,/usr/include/c++/4.1.1/backward/iostream.h,/usr/include/c++/4.1.1/fstream,/usr/include/c++/4.1.1/backward/fstrea
    m.h,/usr/bin/strings,/usr/include/string.h,/usr/include/strings.h,/usr/include/stdio.h,/usr/lib/syslinux/com32/include/stdio.h,/oracle/client/9.2.0/precomp/p
    ublic/sqlda.h,/oracle/client/9.2.0/precomp/public/sqlcpr.h,/oracle/client/9.2.0/precomp/public/sqlca.h,/usr/include/linux/stddef.h,/usr/lib/gcc/x86_64-redhat
    -linux/4.1.1/include/stddef.h,/usr/lib/syslinux/com32/include/stddef.h,/usr/lib/syslinux/com32/include/bitsize/stddef.h,/usr/include,/usr/lib/gcc-lib/i386-re
    dhat-linux/2.96/include,/oracle/app/oracle/client/precomp/public,/user/include/g++-3)
    ltype=short

  • Getting rid of Multiple Spaces in Code View (after Copying/Pasting)

    Hello,
    I'm trying to find a way to get rid of multiple spaces between words in Dreamweaver CS3's code view.
    Oftentimes, when I copy/paste text from elsewhere (e-mail, website, etc), the Dreamweaver code shows up with multiple spaces. Normally, that wouldn't be problem -- except that my blog's auto-tag plug-in doesn't detect selected phrases when there are multiple spaces between words, e.g., it'll detect "Swiss Alps" in a post but not "Swiss  Alps" (notice the extra space between words in the second phrase).
    If at all possible, I'd like to be able to keep Dreamweaver's text formatting option when I copy and paste, as that means I don't need to manually put words in bold/italics.So, is there a way to keep that option while getting rid of all the extra spacing between words?
    By the way, I'm familiar with Wordpress CSS, but not with Dreamweaver CSS. Not sure if there's any difference.
    Any assistance would be much appreciated.

    I make it a point to never paste formatted text into HTML pages.  Formatted text from MS Office usually contains a variety of junk you don't want and I don't have that much faith in MS Word code removal tools.
    Bold and Italics from Word or Outlook should be changed to current HTML tags of <strong> for bold and <em> or emphasis for italics anyway.  Also see Logical Tags here:
    http://www.htmlcodetutorial.com/logical.html
    Find and replace is good for removing whitespace if you know how to do it correctly. Make backup copies just in case things go wrong.  http://www.tjkdesign.com/articles/whitespace.asp
    Nancy O.
    Alt-Web Design & Publishing
    Web | Graphics | Print | Media  Specialists
    www.alt-web.com/
    www.twitter.com/altweb

  • Why would white space and line breaks in sql query increase runtime

    Using 11.2.0.3.0 on unix sprac server, 8 cpus 32 cores 12TB storage. We have 16 batch servers doing inserts and ~100 users doing mostly queries.
    We have a wierd issue,  we have a long query that takes 30 seconds to run 1st time then 10-20 secs every other time. Based on knowledge of DB we expected it to take a lot less.  Then a developer reformatted it by taking removing extra white space and line breaks.  all of sudden query takes 6 secs first time and 0.8 every other time.  we tripled checked to ensure they are identical and that only difference is white space and line breaks.  We tried it with SQLDeveloper, TOAD, SQLPLUS, from out desktops, appserver. we could reproduce it every time, with white space 10-20 secs without it 0.8 secs.  Query is 200 lines long with white space 30 without it.
    Why would having white space make such a dramatic difference?  because the query is longer eventhough its identical?  We checked parsing times, etc, no difference.  Is there some network setting, oracle parameter, sqlnet setting?  We spent hours looking on google and found nother
    Slow:
      SELECT grt_student.student_id                                                                                                                                                                                                 
    AS student_id,
      grt_student.last_name                                                                                                                                                                                                       
    AS last_name,
      grt_student.first_name                                                                                                                                                                                                      
    AS first_name,
      grt_buyerinstance.buyerinstance_id                                                                                                                                                                                            
    AS buyerinstance_id,
      grt_buyerinstance.buyerfamily_id                                                                                                                                                                                              
    AS buyerfamily_id,
      grt_buyer.buyerfamily_acronym                                                                                                                                                                                                 
    AS buyerfamily_acronym,
      grt_reporting_utls_pkg.convert_gmrt_battery(grt_buyerinstance.buyerfamily_id,grt_buyer.battery)                                                                                                                                
    AS battery,
    fast:
    SELECT grt_student.student_id 
    AS student_id,  grt_student.last_name
    AS last_name, grt_student.first_name   AS first_name,  grt_buyerinstance.buyerinstance_id   AS buyerinstance_id,  grt_buyerinstance.buyerfamily_id
    AS buyerfamily_id,
      grt_buyer.buyerfamily_acronym  AS buyerfamily_acronym,  grt_reporting_utls_pkg.convert_gmrt_battery(grt_buyerinstance.buyerfamily_id,grt_buyer.battery)   AS battery,

    Do you have some sort of horrific network connection between the client and the database such that it would take 8.5 seconds to transmit a few kb of SQL to the server?  That seems most unlikely.
    How are you determining the query plan?  Are you absolutely sure that both SQL statements have the same plan_hash_value when they are actually executed (not just when you generate a query plan without executing it)?  What are the differences in wait events when you execute the two?
    The sql_id will change when you add or remove whitespace.  There are various methods of modifying query plans that are tied to a sql_id.  My wager would be that you have a profile/ outline/ etc. that is not there for the reformatted one which is causing a query plan difference.  My next guess is that you have an accepted plan for the old statement, you haven't set up a process to let the plan evolve, and the reformatted statement starts with the plan that the old statement would get if you allowed the plan to evolve.
    Justin

Maybe you are looking for

  • How to install Weblogic Standar Edition 10.3.6

    Is weblogic standard edition supported on 64-bit OS (Linux) ? Where can i download file for this edition ? All I can find is generic installer but there are all options available including cluster and EM, there is pdf that said clustering and EM is n

  • Sequence of images to movie

    How can i create a movie from a sequence of images? (Any format).

  • Need a tip for an image viewer

    Hi guys i'm trying to make an Image Viewer app and i couldn't find a way to tell my main AS3 class which is the Image that opened the application. I already specified images in windows to "Open with" my Image Viewer, and indeed my application execute

  • Library cash statistic in trace file

    Hello! I'm get ora-00600, and in one of trace files I see library cash statistic : LIBRARY CACHE STATISTICS: namespace gets hit ratio pins hit ratio reloads invalids My question - is this statistic cumulative or current ? Please advise . Thanks and r

  • Create a view, some of the columns default are NULL

    Windows XP/10g 10.2.0.1.0 I have a table tab1(test1, test2, test3) And, I need to create a views as: create or replace VW1(test1, test2, viewtest1, viewtest2) as (select test1, test2, viewtest1, viewtest2 from tab1, dual); And need the column value v