wood burning stoves 2.0*
The moose likes I/O and Streams and the fly likes Reading FileName consists of # Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Java » I/O and Streams
Bookmark "Reading FileName consists of #" Watch "Reading FileName consists of #" New topic
Author

Reading FileName consists of #

karthick sambanghi
Greenhorn

Joined: Sep 25, 2013
Posts: 18
Hi All,

I am facing little issue in reading the File Name

I am able to read the below Path contents

C:\DataRead\FBNK_ACCOUNTNAU_1.xml

But i am unable to read it from

C:\DataRead\FBNK_ACCOUNT#NAU_1.xml (Getting as System cannot find the file specified)

i think # is the problem in File Name. Kindly help me to resolve, how to read the file name Consists of #

Please provide me with Piece of example...

Regards/Karthick
Jeanne Boyarsky
author & internet detective
Marshal

Joined: May 26, 2003
Posts: 30789
    
157

Can you show the code you used to read the file along with the error message?

[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
karthick sambanghi
Greenhorn

Joined: Sep 25, 2013
Posts: 18
Hi Jeanne,

Thanks for the reply.

I am using the file Name directory in program arguments. Below is the Piece of code

public static int doWork(String args0)
throws IOException, SAXException,

ParserConfigurationException {
xmlFileName = args0;
}

Where args0 is the directory Path of the file. I am passing the directory path in Run configuration as program arguments.

For example :- When i pass args0 = C:\DataRead\FBNK_ACCOUNTNAU_1.xml (IT is working fine)

But the below one is not working

args0 = C:\DataRead\FBNK_ACCOUNT#NAU_1.xml

Please help me to rectify it.

Thanks in Advance..

Tony Docherty
Bartender

Joined: Aug 07, 2007
Posts: 2332
    
  50
That's not the code that is using the filename and you haven't supplied the error message as requested so it's a little hard to help you without guessing at solutions.
You could try wrapping the file path in quotes that sometimes helps on windows systems (are you even on a windows platform?)
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Reading FileName consists of #