Meaningless Drivel is fun!
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 Java SE 8 Programmer I Study Guide this week in the OCAJP 8 forum!
JavaRanch » Java Forums » Java » I/O and Streams
Bookmark "Reading FileName consists of #" Watch "Reading FileName consists of #" New topic

Reading FileName consists of #

karthick sambanghi

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


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...

Jeanne Boyarsky
author & internet detective

Joined: May 26, 2003
Posts: 32628

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

[OCA 8 book] [Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Other Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, TOGAF part 1 and part 2
karthick sambanghi

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

Joined: Aug 07, 2007
Posts: 2737
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?)
jQuery in Action, 3rd edition
subject: Reading FileName consists of #
It's not a secret anymore!