Manipulating with path

Hello,
Can anyone help me with this:
I would like to work with files wia absolute path (in windows), for example:
d:\work\java\work_folder\test.txt.
How can i do this? I know that it works when i change path like this:
br = new BufferedReader(new FileReader("d:\\work\\java\\work_folder\\test.txt"));But how can i change it? My idea was using regex, but i am not able even create a string with given path.
When I try:
String str = new String("d:\work\java\work_folder\test.txt");I get error "illegal escape character"
then I tried:
  String ss  = new String.replaceAll("d:\work\java\work_folder\test.txt", "\\");and got the same mistake "illegal escape character"
and finaly i tried :
String sss = string.replace('d:\work\java\work_folder\test.txt', '\\');and got mistakes: "unclosed character literal", "illegal character: \92" and "')' expected".
Anyone can tell me if the approach I am taking is correct and if yes how to manipulate the path?
Thx in advance.

There is no need to escape backslashes in this case.
Escaping is required inside your code only, when defining String literal.
This is because some special characters must be escaped, like 'new line' is \n
The backslash is reserved for escaping such special characters.
As a consequence, the backslash itself is a spacial character, which must be escaped: \\

Similar Messages

  • Path palette: What's wrong with "path share" and "path exclude"?

    Hi everybody. First of all: Sorry for my english, but I hope someone can understanding me.
    Well, I want to work with Fireworks in the future because I think that this programm keep in some situation more efficience as Photoshop... So I was trying to learn how this programm is working.
    Since some days I make some experiments with Path's, because I like to work with Illustrator as well. But now, I am still going crazy because I don't understanding 2 options. I don't know the english names but In the path palette does they have this Icons:
    The first option (Pfade teilen) is "path share" and the second one (Pfade ausschließen) is free translate "path exclude"
    My question is: When I can use this 2 Options? I really did everything but nothing was working

    Thanks for posting about this issue! I've taken a look at the "Combine Paths" operations in the Paths panel in both Fireworks CS6 and CS5 on my Mac, and noticed several bugs. Between you and I, here's a summary of what we've found:
    Fireworks CS6, Version 12.0.0.236, WIN, 7, 64 Bit, SP 1
    Exclude Paths - Does not work.
    Fireworks CS6, Version 12.0.0.236, Mac OS 10.6.8 (Snow Leopard)
    Divide Paths - No effect on rectangles.
    Exclude Paths - Requires 2 clicks for rectangles - one to ungroup rectangles and another to apply path operation.
    Fireworks CS5, Version 11.1.0.205, Mac OS 10.6.8 (Snow Leopard)
    Divide Paths - Works like Exclude Paths.
    Undo - Deletes previous unrelated non-path operation. For example:
    Draw two ellipses.
    Draw a rectangle.
    Select two ellipses and apply Combine Paths operation.
    Undo (Command-Z).
    The rectangle disappears!
    You can submit a bug report to Adobe about the "Exclude Paths" issue, and include the URL for this discussion within your report:
    https://www.adobe.com/cfusion/mmform/index.cfm?name=wishform
    In the meantime, I'm going to send an e-mail to the developer about these issues. I know that he's working on a fix for another problem with this panel and planning on releasing a fix at some point, so hopefully these issues can get fixed as well.
    Again, thanks for being so persistent. It is challenging to understand your writing at times; however, the animated GIF was very helpful—and very well done. Have you tried composing your posts in your native language and then using something like Google Translate to convert it to English? I don't know if the results would be better; it's just an idea.

  • [bash] How to uniq files in a file list with paths?

    Hi folks,
    I know I can get rid of duplicate entries in a list by sorting and uniqing:
    sort file | uniq
    But how can I uniq filenames in a file list with paths?
    /foo/abc.bar
    /foo/def.bar
    /foo/bar/def.bar
    /foo/ghi.bar
    Is it necessary to write my own comparison routine like “output thisline if basename(thisline) != basename(lastline)” (would require a basename-sorted input list)?

    arith wrote:
    Hi folks,
    I know I can get rid of duplicate entries in a list by sorting and uniqing:
    sort file | uniq
    Or 'sort -u':
    $ cat test
    a
    e
    b
    d
    c
    a
    d
    $ sort -u test
    a
    b
    c
    d
    e
    arith wrote:
    But how can I uniq filenames in a file list with paths?
    /foo/abc.bar
    /foo/def.bar
    /foo/bar/def.bar
    /foo/ghi.bar
    Is it necessary to write my own comparison routine like “output thisline if basename(thisline) != basename(lastline)” (would require a basename-sorted input list)?
    I came up with
    $ cat test
    /home/karol/test/test0
    /home/karol/test/test/test0
    /home/karol/test/foo/test00
    /home/karol/test/foo/bar/test0
    /home/karol/test/foo/bar/test1
    /home/karol/test1
    $ awk -F/ '{print $F" "$NF}' test | sort -k2 | uniq --skip-fields=1 | awk '{print $1}'
    /home/karol/test/foo/bar/test0
    /home/karol/test/foo/test00
    /home/karol/test/foo/bar/test1
    but I think there's a better way to do it ;P

  • FM for getting teh file name with path

    Hi guys,
    Is there an fm getting the file name with path given the physical path and file name? Thanks!

    Hi Mark,
    Function Module WS_FILENAME_GET is obsolete, dont use it.
    Use the Method file_open_dialog of  class cl_gui_frontend_services as given below.
    DATA:
        lt_filetable TYPE filetable,
        lf_rc        TYPE i,
        lv_filename(50) TYPE c,
        lv_fileext(3) TYPE c,
        ls_file TYPE file_table,
        lv_file TYPE localfile,
        lv_title TYPE string.
      lv_title = sy-title.
      lv_progname = sy-cprog.
      CALL METHOD cl_gui_frontend_services=>file_open_dialog
        EXPORTING
          window_title            = lv_title
          file_filter             = '*.txt'
          multiselection          = abap_false
        CHANGING
          file_table              = lt_filetable
          rc                      = lf_rc
        EXCEPTIONS
          file_open_dialog_failed = 1
          cntl_error              = 2
          error_no_gui            = 3
          not_supported_by_gui    = 4
          OTHERS                  = 5.
      IF sy-subrc <> 0.
        MESSAGE ID sy-msgid TYPE 'S' NUMBER sy-msgno
                   DISPLAY LIKE 'E'
                   WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
        EXIT.
      ENDIF.
    * Number of selected filed must be equal to one.
      CHECK lf_rc = 1.
    * Access selected file
      READ TABLE lt_filetable INTO ls_file INDEX 1.
      CHECK sy-subrc = 0.
      lv_file = ls_file-filename.
      SPLIT lv_file AT '.' INTO lv_filename lv_fileext.
    Revert back if you need clarifications.
    Regards
    Karthik D

  • [CS6] How can I move shapes (created with paths)?

    [CS6]
    I created shapes with the pen tool.
    Then I selected the path selection tool and selected a path.
    Clicked right mouse key, choosed "Fill Path..." or "Fill Subpath"
    (don't know what it means). After filling with a color I get an object in
    the form of the path and I can move the path to another place.
    But I can't move the object in the shape of the path.
    I can't move it with "Path selection tool" because it's no path.
    Then I tried the "Move Tool" but I also can't select the object with it
    instead the whole canvas is moving.
    How can I select and move shapes which were
    created with the pen tool?

    You've drawn a Path then filled a region of a pixel layer.
    To make Shape layers, use the Pen Tool in "Shape" mode set in the Options bar.
    If you really do want to draw a Path and use it to create moveable pixel shape then do the fill with an empty layer targeted.

  • Manipulations with Date

    i need to do some manipulations with dates, as like the following psuedo code.
    date a=feb 14 2007;
    date b=jan 31 2007;
    date c=a+1; //this should do c=feb 15 2007
    boolean before=b<a;//this should do as before= true
    boolean after=b<a;//this should do as after=falsei searched in util.date of API. But some constructors that i cud use do this are deprecated.
    So any ideas..

    Date in general is deprecated.No, not at all. Just many of the methods are. Date
    serves one role and calendar another.fusk u jverd u no nothing you pile of sh!t u got no
    rite to correct me etc blah blah noob loses it :-)Good morning to you too. :-)
    I never use Date. when would you prefer it over
    Calendar?When I want to represent an instant in time without needing to worry about human imposed chunkification into months, days, etc. And I use SimpleDateFormat for going between human enterable/readable strings and the "raw" Date representation.
    The only time I use Calendar is when I want to do day/week/month/year math on it, like "first day of the month" or "add one week" or "midnight on the day represented by this Date."

  • Assorted frustrations with paths

    Please, if anyone has some suggestions, I'm about to throw my computer out the window.  Before we begin, I'm in CS2 (can't upgrade at the moment)
    1.  Having great difficulty working with paths...particularly cutting and joining.  The cutting tool cursor is as close to being "on the path line" as I can get it (zoomed in at 2400 even), yet I keep getting the message that I must use the cutting tool "on a path segemnt or anchor point."  Last count was 32 attempts to cut a single path line.  Pulling my hair our.
    2.  Similar issue grabbing the direction points.  I have the correct anchor point selected, the direction guides are visible and ready, but it takes multiple attempts to "grab" the direction point in order to move it.
    (With both, is there a sensitivity or tolerance threshold setting for the tool cursors that I can adjust?)
    3. Is there a better way to cut a serties of lines (no shape or fill, just lines)?  I'm trying to cut a complex "shape" into a series of lines, without turing the lines into shapes or outlining the stroke...as I need to do more with them.  I can't use any of the Pathfinder tools, and using the knife tool causins Illustrator to automatically join and close up the lines into shapes.  Very frustrating not to be able to do this seemingly simple task.
    Thanks again for any hints.
    G

    1. ...The cutting tool cursor is as close to being "on the path line" as I can get it (zoomed in at 2400 even), yet I keep getting the message that I must use the cutting tool "on a path segemnt or anchor point."
    Which cutting tool are you talking about? Always try to use the terms of the program you're discussing. Ilustrator CS2 has a Scissor tool and a Knife tool. Both are sub-standard. In other drawing programs, a single cutting tool is more capable than all of Illustrator's put together. (This is also true of other multi-tool interfaces in Illustrator.)
    To use the Scissor tool, you have to click right on the path you want to cut. It can only make one cut at a time.
    To use the Knife tool, you drag across one or multiple paths. To make a straight cut, press and hold Alt as you drag.
    The use of the tools is explained in the online Help.
    Stupidly, Illustrator's Knife tool cannot cut open unfilled paths. (Similar problems in handling open unfilled paths permeate Illustrator's feature set. Always have.)
    2. ...it takes multiple attempts to "grab" the direction point in order to move it.... is there a sensitivity or tolerance threshold setting...?)
    I don't recall exactly when Illustrator finally gained its very long overdue pick-distance "sensitivity" setting. CS3, as I recall. See if you have a Selection and AnchorPoint Display pane in the Preferences dialog. Failing that, see if you have a SmartGuides dialog. As I recall, SmartGuides appeared one version prior to Selection and AnchorPoint Display, and SmartGuides has a Snapping Tolerance setting. (You would have to have SmartGuides on to use it.)
    3. Is there a better way to cut a serties of lines (no shape or fill, just lines)? ...Very frustrating not to be able to do this seemingly simple task.
    It's just one of many bedrock basic tasks that Illustrator has been decades late in providing. Such is the entire history of this program. Newcommers to this program are continually frustrated and astonished at the omission and/or difficulty of capabilities they have long taken for granted in other programs. Those without proficiency in competing programs often dogmatically defend its sub-standard features. Truth is, Illustrator's predominance in the market segment is due to marketing success and recognition of the Adobe brand, not to its feature set or its useability. This has always been the case with this program.
    CS3 added yet another cutting tool, the Eraser. The behavior of this feature is also sub-standard in that it cannot make zero-width cuts, and it unpredictably disturbs the shapes of the remaining portions. CS5 added a Shape Builder tool, which can be used much like Corel Draw's Virtual Segment tool to sense path intersections and delete path portions on one side or the other of the intersection.
    These new features, combined with the anemic pre-existing features have improved the overall path-cutting capabilities; but add to one of Illustrator's most problematic and pandemic problems: basic functionality being scattered across multiple unintuitive and poorly-integrated tools and commands.
    Overall, it's the worst-of-class vector drawing interface. It's just the way it is, and always has been.
    One of the best features that could be added to this program would be the ability to draw a path and then use it as either an accurate cutting path or as a selection marquee (with a contact-sensitive option). That would actually be competitively innovative. But don't hold your breath.
    JET

  • Letter with paths??

    Hello
    This letter can do with paths?
    How to do it with photoshop cs6?
    Thanks and Happy New Year 2013
    Photoshop cs6+ windows 7

    Pen tool is going to be your friend...
    Place the letter on its own layer and lock it.
    On a new layer trace with the pen tool then between the pen tool {p}and the direct selection tool {a}you can manipulate the path until it looks like what your after.
    To speed things up, you can convert the letter to an outline first. {Layer>Type>Convert to Shape or Layer>Type>Create Work Path depending on which you want}

  • Wnen Using Systemexec.vi pb with path on XP

    When I want to launch a batchfile with System exec.vi with the batchfile somewhere else than in the working folder of my VI, it doesn't work. The only solution is to put my batchfile in the working folder without path given as parameter. Have you a solution?

    Hi,
    If the path has spaces in it, you must use quotes, like "C:\temp
    directory\batchfile.bat".
    Perhaps that's the problem...
    Regards,
    Wiebe.
    "raymond_73" wrote in message
    news:[email protected]..
    > When I want to launch a batchfile with System exec.vi with the
    > batchfile somewhere else than in the working folder of my VI, it
    > doesn't work. The only solution is to put my batchfile in the working
    > folder without path given as parameter. Have you a solution?

  • What is the better way to change name of a site with paths and links?

    Hi!
    i m using dreamweaver cs4 and i have a site already configured on dreamweaver
    i need to change the name of the site and at the same time, every path names and every links
    This site has about 50 pages so i would like to know what is the better steps to do for modified the name of the site unless problem?
    I read the informations about  'manage site' but its not clear for me about links and path names!!
    thank you

    Just use site manager to change the site name. Nothing complicated with that.
    What exactly do you mean by changing path names? Do you want to change the name of folders in the site? If so, just change them within DW and it will prompt if you want to update links.

  • Read Key and Write Key not working as expected with paths on RT

    The configuration file VIs Read Key (Path) and Write Key (Path) don't seem to work as expected (at least not as I was expecting them to) on an RT target.
    When working on my WinXP PC with these two VIs, paths are translated to what looks like is supposed to be a device-independent format before being written to disk. The path C:\dir\file.txt becomes /C/dir/file.txt when writing and vice versa when reading. On my RT target, however, that same path is written to disk as C:\dir\file.txt, unchanged from the native format.
    The translaton of a native path to and from the device-independent format appears to be the responsibility of Specific Path to Common Path and Common Path to Specific Path. These both use the App.TargetOS property to determine the operating system. In the case structure for these two VIs, however, there is no case for PharLap or RTX. (My RT hardware is runnng PharLap; I don't know enough about RTX to comment.) This means that the results of String to Path or Path to String are used without translating between the device-independent format to the native path format.
    This isn't a problem if you create a configuration file on one machine and use it on that same machine. I noticed this only when tranferring a config file from my PC to the RT target, where the target would not open the file paths it loaded from the configuration file.
    This occurs on 7.1.1 and 8.0.  I don't have 8.20 to see if happens there, too.

    In LV 8.2, this was fixed.
    The problem is App.TargetOS returns "Pharlap" on RT systems, and "Pharlap" is handled by the default case ("invalid OS target") in LV 8.0.  In LV 8.2 the default case is "Windows 95/NT", however.  The reason you could write and read an .ini file on RT in LV 8.0 and earlier is because these two VIs (listed below) were both running the default case of "invalid OS target".
    vi.lib\Utility\config.llb\Common Path to Specific Path.vi
    vi.lib\Utility\config.llb\Specific Path to Common Path.vi
    As you saw, this fails when you perform one operation in Pharlap but the other in Windows.  You can fix this by modifying the two VIs listed above.  Just go to the case structure and make "Windows 95/NT" the default case.

  • How can I do the same as Windows Explorer with datemodified:11/6/2013 .. 11/13/2013 showing only changed files with path in tree and NOT every folder along the way as Finder seems to do by default? Thanks!

    I'm an Apple newbie.
    I'd like to be able to list each file in the "Desktop" tree (ie; on the desktop, or in any folder on the desktop, etc.), along with its path, that has been modified since a certain date.
    When I use Finder to do a similar search, I get tons of output including every folder in the path to the modified file, etc. Although I can view the path to the individual files in the output, I can't for example, order the output by path, etc.  Very difficult to sort through. I'd love to have output like the example above - just the filename and path for each changed file.  Possible?  Thanks in advance!
    Wayne

    The file structure is a little complex. I will use inbox as an example.
    Inbox (a large file with no file extension)
    Inbox.msf ( An index of inbox with tags etc. Can be deleted with only loss of tags)
    Inbox.sdb (a folder, indicating that the folder within Thunderbird has a sub folder.
    POP mail is stored in
    Appdata/Roaming/Thunderbird/Profiles/*.default/Mail/[Server name]/
    Local folder is stored in
    Appdata/Roaming/Thunderbird/Profiles/*.default/Mail/Local Folders/
    As long as you do not overwrite, you can copy and paste whole folder trees into local folders (stuff on your old computer under a mail account is best relocated to local folder and then sorted as necessary afterwards.
    Note that you should delete foldertree.json after making those sorts of copies (it forces a full refresh of the folder tree, no cache) and under no circumstances copy data with Thunderbird running. It can irrevocably corrupt things

  • Problem with Path Managed property in alternate zones - also we have identified problem with Product catalog in alt zones

    Hi All,
    I'll start "one step back". Note we have resolved this issue but it is worth mentioning:
    Yesterday we set up the product catalog. We were having a lot of inexplicable problems with it initially. After much troubleshooting, we found that it was because we were browsing the SharePoint site via the "Internet Zone" rather than the "Default
    Zone" when we "Connected" our site to the product catalog. Issues experienced:
    1) "Catalog Item URL Format" displayed error "Properties <Managed Property> specified by the shared catalog could not be found in the search schema" when attempting to connect to the catalog, despite that managed property being
    configured correctly. The catalog would connect despite the error, and the navigation worked fine.
    2) The search Result Source for the catalog would not return any results. Configuring the query and selecting "Advanced Mode" would show SPSiteURL:http://externalURL.domain.com. Changing SPSiteURL manually to
    http://InternalURL resulted in results being returned as expected.
    After much troubleshooting, we found that if were browsing SharePoint using the default zone (http://InternalURL) when we connected the Product Catalog, the result source then worked properly (internally and externally).
    Ok, so now onto our current problem:
    The Product Catalog appeared to be working properly (internally and externally) after figuring out that we needed to connect it from the Default Zone. However, we have found a remaining glitch, which doesn't appear to be Product-Catalog-specific. Consider
    the following scenario:
    1) We click a category in our Product Catalog, such as Electronics
    2) A list of our electronic devices are presented via the "Category" display page
    3) If we click on a specific item, a different URL is returned internally vs externally. We only get the friendly managed navigation URL when browsing via the Default zone. And of course totally different pages load based on which URL you get.
    Internal (when browsing via Default zone):
    http://InternalURL/catalog/PRODUCT-CATEGORY/PRODUCT-NAME
    External (when browsing via Internet zone):
    http://ExternalURL.domain.com/catalog/Lists/Products/DispForm.aspx?ID=1
    We have reviewed the display template, and the "Path" managed property is simply being used to render the link. Furthermore, we have configured the Content Search web part's "Property Mappings" to show the "Path" MP, and it
    displays the same (wrong) result externally.
    This tells us that the Path MP is not correctly rendering "Friendly URLs" when using managed navigation.
    Any help/ideas?
    Our environment:
    SharePoint Version: 15.0.4667.1000
    Default Zone: http://InternalURL
    Internet Zone: http://ExternalURL.domain.com
    We are NOT using host named site collections
    We ARE crawling the Default zone URL in our content source
    Thanks,
    Tommy

    Hi,
    We have now also observed the same issue with a Managed Property of type “Hyperlink/Picture”. The picture returns the wrong URL externally.
    This post describes the same issue, however the poster found that setting UseAAMMapping=True doesn’t work in 2013:
    http://sharepoint.stackexchange.com/questions/104806/set-the-useaammapping-property-of-a-managedproperty-object-map-an-url-of-a-h
    We checked, and our Picture MP had UseAAMMapping=False. We set it to True, did a full crawl, and see no change in behavior. Path already had UseAAMMapping=True.
    More info:
    http://macslui.blogspot.com/2013/02/sharepoint-2010-problem-in-image-result.html
    https://camerondwyer.wordpress.com/2014/08/04/beware-sharepoint-2013-search-results-and-the-listurl-property/#comment-2606
    Thanks,
    Tommy

  • Issue with Repousse with Paths in CS5 Extended

    Hi,
    Really hoping someone can help, I'm hoping I'm doing something stupid
    1) I drawn out a path using the pen tool
    2) I select the path with the path selection tool !!!
    3) I go to 3d/repousse/selected path...
    I do not see the 3d shape in the repousee dialog. it seem invisible.  If I use the rotate tool it rotates the whole screen as a 3d block
    It seems not to detect my selected path
    I have a brand new iMac 27 i7 8 gb
    PS
    If I do the same procedure with a selection its works ok
    Am I doing something stupid?

    yep I'm stupid!!
    I found my issue and I mention it i just in case someone else comes across  it
    When defining my shape with the pen tool I was not using the  "Add to Path" option

  • Problem with path length when using oracle drive

    Hello!
    Does anybody else experience this problem with Oracle Drive?
    When I create a deep or nested hierarchy in which the path length is longer than 250 (the limit might be 255) characters, I cannot access the deeper subpages.
    Example:"X:\INET\START1\pfadlaengentest\das istein langer ordnername mit etwa 50 zeichen\and this is another veryveryvery long\and this is another veryveryvery lon2\and this is another veryveryvery lon3\and this is another veryveryvery lon4\and this is another veryveryvery lon5".
    I can access the page "and this is another veryveryvery lon4" but not "and this is another veryveryvery lon5"
    Is this problem due to WebDAV?
    What can I do - I think it is a critical error / bug?
    Regards Joerg.

    I opened a service request and oracle support could help me.
    The problem is the windows file system: the path length cannot be longer than 256 chars.
    There's a workaround with MS-Webfolders.
    More information is available via metalink: watch out for SR-Number 5659267.992.
    PS: Thanks to Bert
    bye :-j (joerg)

Maybe you are looking for

  • GR/IR Reporting

    Hello, Are there any reporting options for GR/IR. SPecifically a report that shows all items that have been cleared? Thanks, Justin

  • Lenovo IdeaPad V460 Wireless connection problem

    Hi, this is my first post and one of my most frustrating problems, l have brought the laptop for nearly a year now and l notice a problem with my wireless connections, it was either windows resetting the wireless card or there are a problem with the

  • Purchase Order Number Zeros

    Hi My purchase orders are showing lots of zeros, for example:  PO 16 shows as PO 160000 when it prints. Please can you help me solve this. Thank you Caroline

  • Ansync Web Service is Blocking

    Hello, I have build an asynchronous web service and have implemented a polling interface for my Java client to access it. Here is the call sequence: 1. Client calls "start" method which is buffered and also starts a conversation. 2. Client calls "isR

  • Time Machine - which old backups are deleted?

    Hi,      Apologies if the answer is obvious - just wanted a second opinion.      I'm backing up a 500GB MBP and a 2TB external to a 4TB Time Machine. If I complete a backup right now, can I be sure that everything on both drives is contained on the T