Including \ in a String

hi.
I'm reading a string from a file, to display it in a GUI of the form C:\Program Files
As \ is an escape character, what is displayed in the GUI is C:ProgramFiles
How can I read the string from the file, and escape the \, so that I can display C:\\Program Files, without having to escape the \ in the .txt file that it is read from?
thanks
james

That should be on problem in reading this content from the file. Try following code
import java.io.*;
public class ReadFile {
public static void main(String args[]) {
try {
FileInputStream in = new FileInputStream("test.txt");
byte data[] = new byte[in.available()];
in.read(data);
in.close();
String s = new String(data);
System.out.println("content: " + s);
} catch (Exception ex) {
ex.printStackTrace();
content of test.txt
C:\Program File
Best Regards,
Angus

Similar Messages

  • Error(400,8): method include(java.lang.String, boolean) not found in class

    I have uploaded my Application which was running fine in other IDE to jdev 10.1.3, when i compile the follwing error error in jsp page.
    Error(400,8): method include(java.lang.String, boolean) not found in class javax.servlet.jsp.PageContext
    My jsp code where error is shown is
    <jsp:include page="querySections/generation.jsp" flush="true">
                                            <jsp:param name="TSN" value="<%=strParamValue[1]%>"/>
                                            <jsp:param name="SectionID" value="<%=String.valueOf(lngSectionID)%>"/>
                                       </jsp:include>
    pl help me in solving this its urgent...
    Thanks & Regards
    Lakshmi

    Hi,
    code snippet looks okay and is identical with what JDeveloper generates.
    Frank

  • Include xml from string

    If this xml would have been in file I could have used following code:
    <?xml version="1.0" encoding='WINDOWS-1252'?>
    <?xml-stylesheet type="text/xsl" href="t.xsl" ?>
    <page xmlns:xsql="urn:oracle-xsql">
    <xsql:include-xsql href="order_id_seq.xsql" reparse="no" />
    <xsql:include-xml href="order.xml"/>
    </page>
    But i will be getting xml as string .so could you please tell me how can i include a xml which i will be receiving as a string in xsql .
    Thanks

    I would like to correct the version informaiton. We are using SUN JAVA WEBSERVICES DEVELOPERS PACK (JWSDP1.1).
    Nathan

  • Using include with variables (String)?

    Is it possible to include a *.jspf page from a variable (string)?
    I'm currently trying something like this, but I know it isn't quite correct (the PAGE string is already defined):
    <%@ include file="${PAGE}" %>I'm sure this is simple, but I'm pretty new to using JSP (I'm used to normal Java classes and the JSP syntax can be confusing at first...).
    Thanks!

    Ok, you're mixing up your EL expressions with scriptlet variables.
    These things are not the same.
    String PAGE = "pages/home.jspf"; decleares a scriptlet variable called PAGE
    You can normally access it using the scriptlet expression tag like <%= PAGE %>
    ${PAGE} is an EL expression.
    The EL variables are stored as attributes in the page, request, session and application scopes.
    So ${PAGE} will not give you the value of the scriptlet variable Page.
    ${PAGE} is approximately equal to pageContext.findAttribute("PAGE") in java.
    Probably the easiest fix would be to use a scriptlet expression rather than an EL expression.
    <jsp:include page="<%= PAGE %>"/>The better fix would be not to use any scriptlet code at all in your JSP, and maybe just use the JSTL conditional tags.
    <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
    <c:set var="PAGE" value="${requestScope.page}"/>
    <c:if test="${empty requestScope.page}">
      <c:set var="PAGE" value="pages/home.jspf"/>
    </c:if>
    <jsp:include page="${PAGE}"/>
    //or
    <c:import url="${PAGE}"/>Cheers,
    evnafets

  • Redirects that include a query string

    I have three old URIs for which I wish to return 301 redirects back to the client:
    http://xyz.com/page.jsp?type=a
    http://xyz.com/page.jsp?type=b
    http://xyz.com/page.jspI would like them to respectively send redirects to these URIs:
    http://xyz.com/pageA.jsp
    http://xyz.com/pageB.jsp
    http://xyz.com/anypage.jspI added NameTrans rules to my obj.conf as follows:
    NameTrans fn="redirect" from="/page.jsp?type=a" url="/pageA.jsp" status="301"
    NameTrans fn="redirect" from="/page.jsp?type=b" url="/pageB.jsp" status="301"
    NameTrans fn="redirect" from="/page.jsp" url="/anypage.jsp" status="301"However, after making this change and restarting my server, it appears as though the query string is being ignored, as any of the original three URIs is redirected to /anypage.jsp - why is that?
    Is there some other way to achieve this short of manually replacing all of the original jsp files with new ones that send a redirect to the desired page?
    Thanks,
    Bill

    A more versatile way of doing this would be to use the regular expression matching and backreferences:
    <If defined $query
        and $query =~ "type=(.*)" >
        NameTrans fn="redirect" uri="$urlhost/page$1.jsp"
    </If>This will catch any query string contains type=VALUE and redirect that to host/pageVALUE.jsp . This allows you to have just one if stanza rather than requiring a new if stanza for each possible match (which, while it works, can quickly grow into a nightmare for a sysadmin to have to manage).

  • TS3276 I need feedback for the following issue. When I send email from this 27 inch iMac, the computer adds a string of characters in vertical column that represents the QWERTY key board, all alpha numeric characters are included. Yahoo mail, issue only o

    Restating my issue / question...
    When I send email from this iMac, there is a string of characters assigned. The characters are all the "alpha numeric" characters on the QWERTY key board. This only occurs when email is sent from this iMac. The issue does not manifest when using any other lap top or computer.
    Hence, I have ruled out the issue is a yahoo mail matter.
    Again, I can access the Yahoo mail account form multiple devices and send email without unintended assignment of character strings, but when I send wmail using this iMac, the issue happens everytime.
    Characters are stacked verticaly in a column. It looks as if all characters (except function keys) are included in the string.
    Any ideas?
    GMc

    Please read this whole message before doing anything.
    This procedure is a diagnostic test. It won’t solve your problem. Don’t be disappointed when you find that nothing has changed after you complete it.
    Third-party system modifications are a common cause of usability problems. By a “system modification,” I mean software that affects the operation of other software — potentially for the worse. The following procedure will help identify which such modifications you've installed. Don’t be alarmed by the complexity of these instructions — they’re easy to carry out and won’t change anything on your Mac. 
    These steps are to be taken while booted in “normal” mode, not in safe mode. If you’re now running in safe mode, reboot as usual before continuing. 
    Below are instructions to enter some UNIX shell commands. The commands are harmless, but they must be entered exactly as given in order to work. If you have doubts about the safety of the procedure suggested here, search this site for other discussions in which it’s been followed without any report of ill effects. 
    Some of the commands will line-wrap or scroll in your browser, but each one is really just a single line, all of which must be selected. You can accomplish this easily by triple-clicking anywhere in the line. The whole line will highlight, and you can then copy it. The headings “Step 1” and so on are not part of the commands. 
    Note: If you have more than one user account, Step 2 must be taken as an administrator. Ordinarily that would be the user created automatically when you booted the system for the first time. The other steps should be taken as the user who has the problem, if different. Most personal Macs have only one user, and in that case this paragraph doesn’t apply. 
    Launch the Terminal application in any of the following ways: 
    ☞ Enter the first few letters of its name into a Spotlight search. Select it in the results (it should be at the top.) 
    ☞ In the Finder, select Go ▹ Utilities from the menu bar, or press the key combination shift-command-U. The application is in the folder that opens. 
    ☞ Open LaunchPad. Click Utilities, then Terminal in the icon grid. 
    When you launch Terminal, a text window will open with a line already in it, ending either in a dollar sign (“$”) or a percent sign (“%”). If you get the percent sign, enter “sh” and press return. You should then get a new line ending in a dollar sign. 
    Step 1 
    Triple-click the line of text below to select it:
    kextstat -kl | awk '!/com\.apple/{printf "%s %s\n", $6, $7}' | open -f -a TextEdit 
    Copy the selected text to the Clipboard by pressing the key combination command-C. Then click anywhere in the Terminal window and paste (command-V). A TextEdit window will open with the output of the command. Post the contents of that window, if any — the text, please, not a screenshot. You can then close the TextEdit window. The title of the window doesn't matter, and you don't need to post that. No typing is involved in this step.
    Step 2 
    Repeat with this line:
    { sudo launchctl list | sed 1d | awk '!/0x|com\.(apple|openssh|vix)|org\.(amav|apac|cups|isc|ntp|postf|x)/{print $3}'; sudo defaults read com.apple.loginwindow LoginHook; } | open -f -a TextEdit 
    This time you'll be prompted for your login password, which you do have to type. Nothing will be displayed when you type it. Type it carefully and then press return. You may get a one-time warning to be careful. Heed that warning, but don't post it. If you see a message that your username "is not in the sudoers file," then you're not logged in as an administrator. 
    Note: If you don’t have a login password, you’ll need to set one before taking this step. If that’s not possible, skip to the next step. 
    Step 3
    launchctl list | sed 1d | awk '!/0x|com\.apple|org\.(x|openbsd)/{print $3}' | open -f -a TextEdit 
    Step 4
    ls -1A /e*/mach* {,/}L*/{Ad,Compon,Ex,Fram,In,Keyb,La,Mail/Bu,P*P,Priv,Qu,Scripti,Servi,Spo,Sta}* L*/Fonts 2> /dev/null | open -f -a TextEdit  
    Important: If you formerly synchronized with a MobileMe account, your me.com email address may appear in the output of the above command. If so, anonymize it before posting. 
    Step 5
    osascript -e 'tell application "System Events" to get name of every login item' | open -f -a TextEdit 
    Remember, steps 1-5 are all copy-and-paste — no typing, except your password. Also remember to post the output. 
    You can then quit Terminal.

  • Including a String with HTML format

    Hello,
    Any idea how I can include in a JSP page a String attribute of a bean, so that the format included in the String is being interpreted?
    example:
    String htmlCode = "<td> textext </td>"
    it should display: "textext" (which I will put inside a <tr> </tr>)
    something like <tr> <c:out value="${SessionBean.htmlText}"/> </tr>
    but c:out is also displaying the TD's...
    Thanks!

    grazie bsampieri !
    that's another question...
    Where do I find a good "Manual"?
    Regards

  • Unflatten string to cluster, cluster includes a string

    I am reading in a binary string written by a C++ application.  For example, let's say the string is made up of the following 3 data types:
    1.  16 bit signed integer
    2.  string (10 characters long)
    3.  16 bit unsigned integer
    This is a simplification, but it exposes the problem with unflattening a binary string to a cluster with a string in it.
    I use the Unflatten From String function and the type is a cluster of the above listed elements.  The problem is that Labview has no way of knowing how long the string is.  One work around that I an not very fond of is to insert the string length into the binary string immediately after the 16 bit signed integer.
    I attached a simple example.
    Can anyone suggest any other ideas?
    Thanks,
    Chris
    Chris Reyerson
    Optical Systems Engineer
    Arete Associates
    Tucson, AZ
    Attachments:
    Unflatten from string.vi ‏11 KB

    Hi Jean Pierre,
    Thanks for your response.  Labview 8 offers and even easier way to unflatten a string than what you show in your second example.  One of the inputs for the Unflatten from String VI is, “Data Includes Array or String Size (T)”.  Wire up a false to this node and the string (or array) does not need the four byte length header. 
    Also, Labview 8 asks for the endian type, this is a major improvement for me since previous version of Labview assumed big endian and all my data was little endian.  I can't tell you how long I had to work to find a solution to the problem.
    Thank you,
    Chris
    Chris Reyerson
    Optical Systems Engineer
    Arete Associates
    Tucson, AZ

  • How do I use an Applescript string in Javascript?

    I'm trying to get the contents of a BBEdit window, push them to a textarea on a web page, then click a button.
    Here's the applescript that does it:
    set scrpt to "Testing"
    (* tell application "BBEdit"
    set scrpt to contents of text window 1
    end tell*)
    if scrpt is not "" then
    tell application "Safari"
    set index of window "Question Editor" to 1
    tell document "Question Editor"
    do JavaScript "document.getElementsByName('question')[0].value =scrpt"
    end tell
    tell document 1
    do JavaScript "<clicks the button>"
    end tell
    end tell
    end if
    You'll see some of my elementary debugging at the top. scrpt is a variable that contains the text from BBEdit. You'll see scrpt at the end of the first do javascript() call. If I literally put a string inside the do javascript() call -- removing scrpt altogether -- all is well.
    But no mater how I assign a value to scrpt, either directly or via bbedit, the javascript fails. Any ideas? I wonder if scrpt has something extra around it, like quotes, or if somehow it's not passed as a string.

    Well, the obvious problem is:
    do JavaScript "document.getElementsByName('question')[0].value =scrpt"
    You're including the literal string 'scrpt' in your JavaScript command, so those 5 characters are exactly what's sent to JavaScript to execute.
    A better aproach would be:
    do JavaScript "document.getElementsByName('question')[0].value='" & scrpt & "'"
    note that your scrpt variable is no longer quoted, so AppleScript will embed the variable's value into the command. I've also wrapped scrpt with single quotes to protect the value, in case it has spaces or some such.

  • Value string

    po 100 pc
    delivered 50 pc movement type 101
    stock type unrestricted
    now once i post the delivery in MIGO
    system debit stock(BSX) account and credit GR/IR account
    my question is can anyone tell me the complete chain of valuation and account assignment including the value string
    i mean to say how the system is searching out this g/l/ accounts
    please provide the link with  value string
    I AM CLEAR WITH THIS CHAIN GIVEN BELOW BUT I WAN TTO KNOW HOW  movement type affects this chain
    VALUATION AREA  1000
    valuation grouping code AX
    CHART OF ACCOUNT INT
    BUSINESS TRANSACTION BSX
    VALUATION CLASS  4400
    Edited by: baxter jas on Jan 11, 2008 10:01 AM

    Dear Baxter,
                     Answer for your Question.
       1. In Good receipt  System Generate 2 - Document.
          ( A. Material Document , B . Accounting Document.)
    2. BSX   or Store Account or Material Name    Dr.
                                               Gr / Ir Account    Cr.
    3. In MIRO  also System Generate         2 -  Document.
         ( A. Material Document , B . Accounting Document .)
    4.  Now                                   Gr / Ir  Account   Dr.
                                                  Vendor Account   Cr.
    After MIRO  System Cancel the GR / IR   Account.
         Now     BSX  or Store Accoutn or Material       Dr
                     Vendor Account                                 Cr.
    Next Question of your's how system determine GL Account.
    Answer.
              1. Each and Every material have Own Valuation class.
               2.Every Valuation Class Link with Gl Account.
               3.Valuation Class and G.L Account Link With
                  Valuation Grouping Code.
               4. Valuation Grouping Code Link With Valuation area.
               5. Valuation area link with Company Code.
               6. Comany Code Link with Chart of Account.
    I Think it is some what Helpful for You.
    Regards,
    Rajan.

  • How to return a string in chronological order?

    I have a string called schedule, for example:
    schedule = "^14%Paul's house?Group Meeting\n^9%Nutty Professor's Office?Office Hours\n^12%MegaBits?Lunch"
    After breaking it up using StringTokenizer, how do I return it into chronological order?
    Return the schedule for each day of the week as a String with the appointments listed in chronological order, starting with those for the first day of the week and ending with those for the last day of the week.
    The String should have the following format
    Sunday:
    ^14%Paul's house?Group Meeting
    Monday:
    ^9%Nutty Professor's Office?Office Hours
    Tuesday:
    ^12%MegaBits?Lunch
    Wednesday:
    xxx
    Thursday:
    xxx
    Friday:
    xxx
    Saturday:
    xxx
    xxx is the String representation of the schedule for each day. There should be no newline after the last schedule.
    Note: if there are no appointments scheduled for a certain day, then that day should not be included in the String. (For example, if there are no appointments scheduled on Tuesday then:
    Tuesday:
    xxx
    should not be included.)

    Well, then,
    i would assume you need to keep 7 variables, that hold the 7 values of the days,
    then append the values together in the natural order using +

  • Special characters in a javascript string...

    Hey folks, in the javascript project I'm working on, there's a requirement that an SOH character (start of header, #1 in the ASCII character set) be included in a string. Does anybody know how that character can be inserted in a javascript string? Thanks in advance.

    Thanks to both of you for your good advice. One last question: the project that I'm working on involves exporting the contents of an Adobe InCopy CS2 document to a text file. Before the export occurs, I insert a line that starts with ACSII character 1 and ends with ASCII character 2 , at the top of the file. This tells a subsequent process how and where to push the file. The export is working as it should. However, the ACSII control characters are not exported with the text file. Any thoughts on how, or if, this possible?

  • How to present a Column which includes multi lines

    Hi,
    In Oracle BI Publisher 11g, I'm trying to present a column which includes a long string with <CR>.
    Like an Example:
    abc
    def
    ghi
    But, It presents the all sting in one line like:
    abcdefghi
    How can I present it as its stored in the Database?
    Thanks.
    Edited by: Hadar on Feb 18, 2011 6:55 AM

    Thanks BipUser,
    This is not the same issue.
    I'm Talking about a column which includes multi lines.
    When I select it from SqlPlus:
    Select col1 From Tab1 Where rownum <2;
    I got:
    abc
    def
    ghi
    But, from Bi Publisher I got:
    abcdefghi
    Why? and how Can I Present it as it saved in Database?

  • Receiver HTTP Adapter Dynamic Query String

    Hello,
    I am using HTTP Adapter on receiver side.
    My URL is  <b>http://server:port/abc/def?xyz=123&luw=345</b>
    When I am using Adapter specific attributes.
    If I check apply Parameters and pass
    Parameter 1 as xyz and Parameter 2 as luw and pass their values through dynamic configuration will they get appended to the dynamic querystring
    http://server:port/abc/def at the end and I get back the complete URL.
    Can this be achieved? I am stuck on this.
    Regards,

    Srihari,
    The best way to debug this and check what is happening would be to use the TCP gateway tool as shown in this blog by Stefan Grube.
    /people/stefan.grube/blog/2007/03/29/troubleshooting-soap-http-and-mail-adapter-scenarios-with-tcpgateway
    Send the request to the TCP gateway and forward it from there to the correspionding target.
    You will be able to see the URL being passed including the Query String parameters.
    Regards
    Bhavesh

  • How can I search the tree with a given string?

    How can I search the tree with a given string?
    I don't find any function like "search(...)".
    I want to find the tree nodes which include the given string.
    Thanks.

    Try it with .com instead of .ca - fixes it for me (corporate firewall blocks .ca here)
    http://spendolini.blogspot.com/2013/09/working-with-apex-tree.html
    Anyway - it links to an article of mine which describes interacting with the tree: Tom's Blog: Working with the tree in Apex. There is also a demo application on apex.oracle.com: http://apex.oracle.com/pls/apex/f?p=54687:38

Maybe you are looking for

  • Why CallsAnsweredToHalf is greater than CallsHandledHalf in daily report?

    I am using Cisco 8.5.2. I understand the definition of CallsHandled and CallsAnswered. They may not always equal because it may counted in the next reporting interval. However, why it doesn't equal in a daily report? Checked Termination_Call_Detail h

  • Nested blocks

    hi i am new user for oracle .i want know about pl/sql block can i write this DECLARE      V_tEMP1 VARCHAR2(20) ; BEGIN      V_tEMP1 := 'SECOND BLOCK';      DBMS_OUTPUT.PUT_LINE(V_tEMP1);           CREATE OR REPLACE PROCEDURE SP_TEST           IS     

  • Jdeveloper more font family CSS

    Hi I need to use more fonts than the css has by default (jdev 11.1.2.3.0) look image http://img33.imageshack.us/img33/2567/7fuy.png

  • SOLVED !!! Import Excel Null column problem

    Hi all, Import data from Excel is fine as long as there's is no column in target table that is Varchar2(1) and Null allowable. If there's the above type, the DML for the insert always replace the null column with 'NULL' resulting in SQL Error:ORA-128

  • What is the «iPhoto Library link» file for ?

    Hi ...  In the Pictures (Images in French) folder, what is the «iPhoto Library link» alias file for ?  It points to the «iPhoto Library»in the same folder.