Filename trouble.

     I just started work for a photographer. He has thousands and thousands of pictures. He owns a tropical plant nursery and he takes pictures of plants from all over the place. Now he wants to organize the photos to eventually post them onto a website. One problem i am having is with the filenames (DSC_4639.jpg). He has gone through the filenames so many times some of the photos have the same name. I suggested we start changing the file names in lightroom. Such as, all the banana trees would be changed to Banana_trees1.jpg. etc. Is this the right way to go about it? Also most of the photos need to stay in the correct sequence because he takes a picture of the scientific name of the plants and then the plant. I do not have the knowledge of plants that he does so i need the names to stay in order to idenity the plants. Will this change the order? Any help anyone can offer would be greatly appreciated. Working with SO many photos of plants is really confusing it in self. 0

function(){return A.apply(null,[this].concat($A(arguments)))}
Lee Jay wrote:
hillrg wrote:
function(){return A.apply(null,[this].concat($A(arguments)))}
Lee Jay wrote:
Only if they are potentially for the same customer.  Why is having duplicate metadata like date and filename both with the same information good?
Well, if you are going to automate file naming you have to use metadata...
No you don't.  You could just use a sequence number if all you want to do is prevent duplicates.
If the filenaming can be automated, then it doesn't add value to what's already there.  That's why naming files and folders by date never made any sense to me, and that's why I've never done it.  My folder names add value by containing useful information and my filenames are only named in such a way as to avoid duplicates in the same event/folder.
That's fine Lee Jay.  I wasn't trying to convert you, just passing on how most people deal with the issue to the original poster.

Similar Messages

  • Why does Bridge have trouble with accents in filenames?

    We work in an in-house studio with Creative Suite 4. Being in Montreal, Canada, many of our documents have accented characters in the file and folder names. When Bridge attempt to display these accented filenames, occasionally the capital letters get converted to lowercase letters and a trip to the Finder window (we are on OS X 10.5 and 10.6) shows folders doubling, tripling and then going back to normal with no human intervention, as if 'springing' on its own. The files are on a mounted server. The folders and files are created through Adobe Bridge CS4 or through the dialog box in InDesign CS4, Illustrator CS4 and/or Photoshop CS4.
    I've posted a video on my Dropbox account so you can see the problem.
    http://dl.dropbox.com/u/4289569/Business/jumping%20window.mov
    We've contacted Apple and they say it's not their problem. Is there a known bug regarding this that Adobe is aware of?

    When Bridge attempt to display these accented filenames, occasionally the
    capital letters get converted to lowercase letters and a trip to the Finder
    window (we are on OS X 10.5 and 10.6) shows folders doubling, tripling and
    then going back to normal with no human intervention, as if 'springing' on its
    own. The files are on a mounted server.
    Creating folders in Finder and Bridge with accents in the file and folder
    name (although I've always learned this is a bad thing to do but I
    understand the need for your use) is no problem on a stand alone
    configuration.
    I believe it has more to do with the use of working with a server. For best
    answers you could open a case with Adobe Tech Support using the contact
    button and explicit name the use of a server in the description.
    Hopefully you get a better answer from them then from 'not our problem'
    Apple...

  • I am having trouble with downloading a zip file. When I do, it gives me the error message (filename) could not be opened, because an unknown error occurred.

    (filename) could not be opened, because an unknown error occurred.
    Try saving to disk first and then opening the file.

    *kb.mozillazine.org/Unable_to_save_or_download_files
    *https://support.mozilla.org/en-US/kb/cant-download-or-save-files

  • Trouble with reformatting screencapture filename

    Hi - I just upgraded to iOS Lion 10.7.3 and am trying to follow instructions from file:///Users/Microcenter/Desktop/10.6%20%20Remove%20time%20date%20stamp%20from% 20screen%20shot%20filenames%20-%20Mac%20OS%20X%20Hints.html to remove the date stamp from the screen capture filenames.
    In Terminal, I am getting an error message:
    TextEdit[30561:7d0f] NSTrackPersistentURLs: LSSharedFileListInsertItemURL() failed at inserting URL file://localhost/System/Library/CoreServices/SystemUIServer.app/Contents/Resour ces/English.lproj/Localizable.strings (/System/Library/CoreServices/SystemUIServer.app/Contents/Resources/English.lpr oj/Localizable.strings)
    Can anyone help me understand what this means and how I can proceed according to the abovereferenced link, i.e.,
    Type (copy) into Terminal:
    sudo /Applications/TextEdit.app/Contents/MacOS/TextEdit /System/Library/CoreServices/SystemUIServer.app/Contents/Resources/English.lproj/Localizable.strings
    After you type your password, TextEdit will come up and it will open a  text file (Localizable.strings) with root editing powers. Search for  these lines:
    /* Format screencapture file names */
    "%@ %@ at %@" = "%1$@ %2$@ at %3$@";
    Between the quotes on the right side of the equals sign is the date and time addition. Just edit it, something like this:
    /* Format screencapture file names */
    "%@ %@ at %@" = "Screen Shot";
    Make sure to not leave this empty! Using the above example, the first screen shot file will be named Screen Shot
    , and then Screen Shot 1
    , Screen Shot 2
    , etc.
    If you are using a system language other than English, change the  Terminal command as needed. For example, French.lproj, German.lproj,  etc. When you are ready, use Save (not Save As) in TextEdit and quit. If  you want to see the result immediately, restart the SystemUIServer in  Terminal:
    killall SystemUIServer
    TIA

    For one, your link is broken - you can't use file:// links on the discussion boards since 'file' links are inherently local to your machine.
    In either case the problem is that your instructions are outdated.
    In older versions of Mac OS X, the Localizable.strings file was, indeed, a plain old text file, and something that could be edited with TextEdit, but that's all changed.
    The Localized.strings file is now a binary .plist file - in other words, something that TextEdit can't handle.
    In addition, that file is no longer the right file to edit. The format strings are now located in ScreenCapture.strings, not Localizable.strings.
    You'll need an application cabable of editing binary .plist files in order to make the changes you want. Apple's Property List Editor (part of the XCode suite of tools available in the Developer Center) can do this, as can third-party software such as PlistEdit Pro.

  • Troubles with Attached Filenames

    Has anyone run into a situation where there attached files change names to something of the form ATTxxxxxx.dat?

    Are you settings the attachment file name?
    part = new MimeBodyPart();
    DataSource source = new FileDataSource(selFile)
    part.setDataHandler(new DataHandler(source))
    part.setFileName("NAME");

  • CFContent open file with # in filename

    I am trying to launch a file when the user clicks on a link. Sometimes the filename has a # sign in the name, like "My File #1.xlsx". When they click it, they get an error saying "The file specified in the contentTag does not exist" and then the shows .../My File not found.
    Additionally, though I can't remember for sure at the moment, I think I've had trouble with a few other characters such as  ^, *, ?, ", <, >, |. And consecutive periods (.) like My...Filename.xlsx. However, I can live with that problem but not the # in the filename!
    Surely there's something I can do to launch such a file.
    Here's what I'm using:
    this is the call: <td><a href="./fileopener.cfm?attached_file=true&file_location=#qryGetFileNames.ServerDirectory# \#qryGetFileNames.ServerFile#">#qryGetFileNames.ServerFile#</a></td>
    <cfset file_location = "#url.file_location#">
    <cfheader name="content-disposition" value="attachment;filename=#file_location#">
    <cfcontent deleteFile="no" file=#file_location# reset="yes">
    Thank you.

    Have you tried escaping the # ?
    #replace(file_location,"#","##","all")#
    OR
    In the URL: #URLEncodedFormat(qryGetFileNames.ServerFile)#
    ^_^

  • Mac vs PC ads have incorrect filename in hyperlink

    Two of the Mac vs PC ads cannot be downloaded because the filename associated with the hyperlink is incorrect or there is some sort of Javascript problem.
    The URL is: http://www.apple.com/au/getamac/ads/
    The problem ads are: "Tech Support" and "Sabotage"
    There is a certain irony in the fact that there is a problem only with these two ads.
    Please note that they can be successfully viewed in QuickTime but cannot be downloaded.
    The error messages refer to the filenames:
    apple-getamac-tech-support_480x396.mov
    apple-getamac-sabotage_480x396.mov
    Error message tesxt is: "0 bytes of ? - file does not exist"
    My guess is that the resolution in the filename should read "480x376".

    Mark Mothersbaugh of "DEVO" fame composed the distinctive music (“Having Trouble Sneezing”) heard in the award-winning "Get A Mac" commercials (seen on TV and online) for Apple Computer 2006/2007
    http://en.wikipedia.org/wiki/Mark_Mothersbaugh
    Note:
    Look under career it's the last sentence.

  • Can I over-ride the default setting in Organizer to allow sorting photos by filename ?

    I am converting slides from the 1970's and 80's to digital files and using PSE 8 to Organize them but it is important to me that they stay in the order of the file name I give them and NOT "Date: newest first or last" because it would seem that PSE, in the absence of metafile information, uses the date and time I uploaded the file to the Organizer as the "Date:".  ACDSee has a much more sensible arrangement in giving me full control of how my photos are sorted.  I am being driven to using ACDSee as the organizer and PSE as the photo editor, a not very convenient arrangement.  So my question is, "Can I over-ride the default setting in Organizer to allow sorting photos by filename ?"

    The type of file system that you're trying to set up, is actually done better by creating you own file heirarchy in Windows, and then viewing by import batch.  For example; you might create a top level folder "My Slide Scans", then perhaps, "My son John". So, the scans of john all go in the same folder, you import the folder in one batch, and you're where you want to be.
    That said, PSE will fight you at every turn to do this, since with the scanner hooked up with PSE, PSE is going to want to store your photos in "scanned photos" and import them as you scan them.
    I woud suggest this.  After the scan and import, use PSE to move the photos to their final destination folder, say " Hawaii 1994", and create a tag of the same name". Then when you're done scanning photos of this event, use the tag to view all the scans at once. Then, delete all the photos from the organizer. (Yeah, sounds radical I know). Take heart! All you've gotta do then is to reimport the whole folder. All the same name photos will be in one import batch. And with all the photos of any given topic in one folder, you'll be able to also use Windows Explorer in any number of modes to view the photos outside PSE.
    Keep in mind you can rename batchs of photos by selecting them, or by import batch or even tag, then "Ctrl. > Shift > N" will bring up the name change dialog box.
    This technique is quite contensious, but, it makes a whole lot more sense than storing all your photos in the "My Photos" folder on the "C:/" drive where any viral or malware hiccup might cause the necessity of a reformat, which could cause the loss of years of work.
    If a name search is a priority, that would be "Ctrl ."Shift" > "K" then type in whatever your heart desires.
    Caution: Before attempting a delete/ reimport manuver, Alway, always, write the tag and file info to the photo. "File" >"Write Tag and Properties Info to File".
    I always am quite adamantine about suggesting that you do NOT use the same physical HDD that contains Windows to store your photos, that's just asking for trouble. HDDs are quite cheap nowadays, and they're worth every penny in piece of mind. Plus to use a storage ("Volume") drive, you have to create your own file heirarchy anyway, so that leads right back to the beginning of this discussion.

  • Trouble displaying icon on push button in 6i Forms

    Hi,
    I'm having trouble displaying an icon on a button at both design and run times. I'm using Forms 6i with client/server enviornment. I have tried to follow several forums regarding icon setup and the Whitepaper articles. I have tried different suggestions but am still unable to get the icon. Here's my latest attempt:
    1. Copied .jar file to C:\Oracle_Developer_9i\forms90\java folder
    2. Modified formsweb.cfg (in the serverApp=default section) and included the following:
    archive_jini=f90all_jinit.jar,myAppIcons.jar
    imagebase=codebase
    3. In button's properties I set:
    iconic = 'Yes'
    icon filename = C:\Oracle_Developer_9i\forms90\java\myAppIcons.jar
    My guess is that I didn't copy the icon files (from the .jar file) correctly. As suggested in the Whitepaper, I don't have the c:\ myApp\ icons directory. I did a search for an icon directory and found multiple icons folders (due to other oracle projects installed on my pc) but don't know which one to use. Being that I'm using 6i and the instructions were for 9i I didn't know if the directory/folder name is different. Is there another directory/folder (using 6i) where I should copy all the .gif files from in addition to storing the .jar file in the C:\Oracle_Developer_9i\forms90\java directory?
    Also, I feel that I'm not calling it correctly from the location in step 3. Being that the icon exists in the jar file, how would I reference it within the file? Does anybody have any suggestions? Any help would be greatly appreciated.
    Thank you,
    Eric

    Robin,
    I tried your suggestions but am still unable to view the icon. Here's what I now have tried.
    1. I've created UI_ICONS in the windows registry under the form's oracle home and am calling c:\icons from that variable.
    2. In c:\icons, I copied the .jar file's contents (search.gif) into this folder. This is where I may have a problem in addition to my next step in calling the filename. You mentioned in your first post to put my .ICO files there. Should I rename my .gif to .ico? Not sure if I followed you there.
    3. In the button property, I set icon = yes and icon filename = c:\icons\search.gif -- Not sure if I used the right syntax for the filename. I've tried renaming it to .ico and it still does not display.
    Sorry about all the questions but I really appreciate your help. Do you see anything else that I did that may cause it to not display?
    Thanks again,
    Eric

  • XCode 3.2.4 - issue after filename or path change

    steps to reproduce:
    this code use to work, it is designed to display a random image in a UIImage field in my app.
    Trying to troubleshoot an issue where I was getting "all black" displaying occasionally, instead of a random.jpg type image, I changed the filenames to make a folder full of random image's filenames even shorter, and changed the relative code to reflect the change:  now it NEVER works, although either version builds with no errors. The arc4random number (in blue) matches the item count in my folder full of random images.
    Is XCode having trouble clearning out the cruft or perhaps this is a bug ?
    -(IBAction)RANDOMPRINT
         //this is the old code which used to work
              int randomInt = (arc4random()%89) +1;
      //convert INT to string
              NSString *fileName = [NSString stringWithFormat: @"fingerprint%d.jpg", randomInt];
      //load UIImage from the filename
              UIImage *image = [UIImage imageNamed:fileName];
      //display UIImage in UIImageView
              [imageView2 setImage:image];
    -(IBAction)RANDOMPRINT
         //this is the new code which never works
      int randomInt = (arc4random()%89) +1;
      //convert INT to string
      NSString *fileName = [NSString stringWithFormat: @"print%d.jpg", randomInt];
      //load UIImage from the filename
      UIImage *image = [UIImage imageNamed:fileName];
      //display UIImage in UIImageView
      [imageView2 setImage:image];
    Tried:
    1. I checked the IB file and even rebuilt the "wiring", its done correctly, same way my other image fields work and they are operating correctly.
    2. tried doing the "clean all targets" thing but that didnt get it
    3. tried restarting laptop
    4. ran Repair Permissions ....
    Any other suggestion would be most welcome. Perhaps this is a bug ?

    ok circling back to my  original issue, I may have figured out the problem:
    my folder full of images had 3 char padding, ie:
    filename001.jpg
    filename002.jpg
    filename003.jpg
    filename061.jpg
    and as you can see from my code below that was not reflected in the code statement ala:
    (arc4random()%61) +1;
      //convert INT to string
              NSString *fileName = [NSString stringWithFormat: @"print%d.jpg", randomInt3];
    apparently you have to have it like this:@"print0%d.jpg"
    This doesnt strictly make sense to me since the "d" should just be a wildcard for anything that follows.
    But somehow adding a zero makes my code work again. 
    As far as the renaming of Actions and Outlets it would appear under certain circumstances this is a known issue. Research it yourself, if you dont believe it.
    In my case, renaming an Action in my code, saving the Project, then renaming it back, disabled the Action. The expected result is that it would "work" again. That didnt happen. This was a rename of one action in the .h file, nothing more.

  • Receiver determination using substring in filename in file adapter

    Hi
    In PI 7.11 I would like to determine the receiver based on a substring in the filename in a file receiver adapter. I am planning on using a context object but am having trouble entering the correct code in the "Right Operand" field.
    I have tried selecting Context Object = Filename http://sap.com/xi/XI/System/File and entering this code in the Right Operand: "contains(substring('_4000_'))"   and an "=" in the as I am looking for a filename, that contains the substring "_4000_".
    I would like to avoid using an extra map and using Dynamic Configuration, as I thing this would be the most elegant way of fixing it
    Is there a way of referencing the context object if I chose xpath in stead of context object?
    MIkael

    Hi Mikael,
    I have the same scenario like you , could you please tell me about the condition how to you use XPath for Context Object
    I need to check the file name and according to that I have to put the file in the different directory.
    Source File: XXXX_IN_xxxx
                       XXXX_PH_xxxx
    I have to check the 7th and 8th Char of the file and according to that I have to place the file in the folder
    Target: DGE008\IN\Inbound
                DGE008PH\Inbound
    I don't know how to used the XPATH for file and specially how to use the substring in that.
    Could you please help.
    Thanks,

  • In Lr 3.6 how can I search for filenames ending with a # character ?

    The text search seems to treat the # character in some mysterious way so as to not select the files that have it in their name. I cannot find any explanation for this in the documentation. Is there some other character(s) that I have to put beside the # to make it register as a normal character ?
    My specific problem is that I need to locate a bunch of files in my catalog that have names ending with a # character. I want to rename those files in a way that removes the trailing # but not other # characters that separate key parts of the file names. If I can't do that then I want to select that group of files and produce .xmp files for them (I don't normally use .xmp files) so that I can rename the files outside Lr and import them again complete with all previous tweaks and metadata.
    I dare say that I would not choose to name files this way if I started again but I've got far too many to change now. 
    There are also too many for me to want to rename them individually in the Metadata panel if I can avoid it.
    I'm using Lr 3.6 on Mac OSX 10.6.8
    cheers,
    - Alan

    You guys beat me to the answer, which I discovered more by accident than good management.
    Firstly, I had used the # characters because they looked good in list views such as in Windows Explorer or the Mac Finder. That was from before I got into using Lr and I was trying and using several different programs to manage my photos. Then I found that trailing # characters prevented Lr from recognizing the number at the "end" of the file name and so I wanted to delete them.
    Secondly, I got into the Lr rename facility initially to replace what I did with Downloader Pro before switching from Windows to Mac and subsequently found that there is no way to delete a trailing character, but it helped establish in my mind that to Lr the "filename" was just the first part of the name before the full stop and the extension (e.g. .cr2 or .nef or .jpg). Try it - there is a "filename" token for setting up a naming structure that ignores the extension and its full stop.
    This was further reinforced in Library Grid View where the filename and the extension are separated and the extension is not displayed.
    So having used F2 (rename) before I got around to playing with the text search I was set up for failure. Looking for {filename ends with #} or {filename ends with #.} failed because it found nothing as none of my files had a # or #. after the filename extension, and looking for {filename contains #} also failed because it found all of my files instead of just those with the trailing #. I wrongly thought that Lr had trouble seeing a # in the text search.
    Now I have been able to find and select all files with a trailing # in the base part of the filename by looking for {filename contains #.} and generate current .xmp files for them. Then I went outside Lr and used a utility file renamer to get rid of the offending # for the image files and the .xmp files in bulk. Then I re-synchronized the folder(s) in Lr to import those renamed files back into Lr along with all of the metadata, and get rid of the old files from the catalog. Had those files been a part of a collection or stack then I suspect that membership of the collection or stack would have been lost but it kept the keywords, ratings, labels, and image tweaks. Then I got rid of the .xmp files again because I prefer to work without them (less clutter and less chance of other software separating them from the image files).
    So much easier than doing it the hard way
    Thanks for your help.
    - Alan

  • OH! ...look, my filenames were changed... does it matter?

    Heres something odd i have just noticed...
    using dos the contents of my directories "used" to look like this:
    c:\jEdu\JHTP\chptr3>dir
    Ex3_1 (.java file)
    Ex3_1 (.class file)
    Ex3_2
    Ex3_2
    Ex3_3
    Ex3_3
    Ex3_4
    Ex3_4
    then using explorer i rearranged my dir names & copied my workinto my
    new directory structure...and my filenames were changed...
    c:\jEdu\JHTP\exerc\chptr3>dir
    Ex3_1~1 java
    Ex3_1~1 class
    Ex3_2~1
    Ex3_2~1
    Ex3_3~1
    Ex3_3~1
    Ex3_4~1
    Ex3_4~1
    i know that the ~ means that the filename was too long...
    but as you can see i have short filenames, i deliberately picked short filenames based on chapter & exercise numbers to explicitly avoid this problem... so what has happened that my filenames in dos have ~ added to them? In explorer they do not show the ~, they show the old names like
    Ex3_2 java file (forte)
    ...i dont know.. does it matter?
    have re-installed jdk & still havin trouble executing applets...
    ...trying to work out the bug, lets not go over whats wrong with the applet code... did that stuff all last week.

    What you're seeing is normal. My 98SE uses a "~" in all .java and .class names (even short ones) when viewing the names in DOS. This is due to the truncation of .java to .jav and .class to .cla.
    Examples:
    Long File Name ==> DOS File Name
    AnyLongName.java ==> ANYLON~1.JAV
    OtherLongName.class ==> OTHERL~1.CLA
    Button.java ==> BUTTON~1.JAV
    Actor.class ==> ACTOR~1>CLA
    ABC.java ==> ABC~1.JAV
    A.java ==> A~1.JAV

  • How can I load pics from camera without spaces in the filename (PSE5)

    Hello,
    I want to load the pics from my Fuji Camera with my newly acquired Photoshop Elements 5 into its database as simple as possible. I get offered several ways of renaming the pics during the import. Unfortunately the date formats offered (for folder or filenames) do *all* include space characters " ", which I do not like, because this caused me earlier a lot of trouble when putting the pics online, for example (%20 in the path name). Another reason is my existing photo collection since 2001, which has no spaces in the filenames as well.
    Example for the filename:
    PSE offers: "jj mm dd 001.jpg"
    I want : "jjmmdd_001.jpg" or at least "jj_mm_dd_001.jpg" or anything similar.
    For folder names the same thing appears.
    Is there a way to do that without typing each date without spaces by hand?
    How?
    I would like to have the photo load process as simple as possible, without having to remove the spaces with a separate rename tool.
    Any ideas?
    I searched for quite a while and I am surprised that nobody else seems to have this problem. Am I just too picky?
    Thank for any help.
    Greetings from Germany,
    Ulrich

    Ken,<br />again thanks for your writing.<br /><br />IMHO, if PSE had space free filenames, this would lead to a very simple and fast workflow with PSE alone (!) like this:<br /><br />1. Just connect my camera (Fuji F31fd) with the USB cable (no fiddling with the memory card in and out each time)<br />2. Transferring all (or selected) pics into PSE, one folder per day, named yymmdd_optional_theme_description.<br />3. Delete all non-optimal pics after viewing in PSE. Then tagging, pic-improving where needed ....<br />4. As backup, burn/move to CD from time to time and copy/move to an external HDD for double security.<br /><br />Its just the spaces in the filenames which prevents me from using this. I want to have the workflow well defined and fixed before I start using PSE5. <br />But it seems there is no workaround (so far).<br /><br />Maybe I should just take the "trouble" and rename every folder manually within PSE. No problem with one or 2 days, and still not a very big problem after a 3 week holiday. But still all single photo files will have the spaces in them. If I want to avoid that, I really have to bring them to the PC without PSE, rename them as batch with Irfan or any other tool, and then import them to PSE, as you wrote. From my point of view, a lot of unnecessary hassle, especially if I have the simple workflow from above in mind.<br /><br />Many people seem not to be disturbed by the spaces in the filenames. I wonder if I overrate the disadvantage of it. Your opinion(s)?<br /><br />I am not sure what you mean with<br /><Perhaps Ulrich would be well served if he created a collection of newly acquired pictures with a common theme.><br /><br />In fact I want to come away from theme centered archiving the photos, which is what I did so far. I learned this from the article <br />http://forums.dpreview.com/forums/read.asp?forum=1018&message=26366116 <br />and the following one from Arrowman. I won't follow all what he wrote *in detail*, but most ideas seem to be good. The PSE tagging should do the theme-related searches.<br /><br />Greetings,<br />Ulrich

  • I'm having Trouble with a Simple Histogram

    The program as a whole is supposed to read a text file, count the number of words, and ouput it. For example, "The The The pineapple pineapple" should ouput "The 3, Pineapple 2" I've gotten as far as dumping the tokens into an array and creating 2 empty arrays of the same size(word, count), but I don't know how to do the double loop that's necessory for the count. Please see my "hist()" method, this is where I'm having trouble. Any suggestions at all would be greatly appreciated. import java.io.*;
    import java.util.*;
    /*class Entry {
        String word;
        int count;
    class main { 
        public static void main(String[] args){
         main h = new main();
         h.menu();
        String [] wrd;
        String [] words;
        int[] count;
        int wordcount = 0;
        int foundit = -1;
        int size;
        int numword = 0;
        int i = 0;
        int j = 0;
        int elements = 0;
        public void menu() {
          System.out.println("Welcome to Histogram 1.0");
          BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
          while(true){
              System.out.println("Please enter one of the following commands: open, hist, show, save, help, or quit");
              String s = null;
              try {s = in.readLine();} catch (IOException e) {}
              if (s.equals("open")) open();
              else if (s.equals("hist")) hist();
              else if (s.equals("show")) show();
              else if (s.equals("save")) save();
              else if (s.equals("help")) help();
              else if (s.equals("quit")) {
                  System.exit(0);
         public void open(){
         // prompt user for name of file and open it
         System.out.println("Enter Name Of File: ");
         BufferedReader in = new BufferedReader(new InputStreamReader (System.in));
         String filename = null;
         try{ filename = in.readLine();}
         catch(IOException e)  {}
         BufferedReader fin = null;
         try { fin = new BufferedReader (new FileReader(filename));}
         catch (FileNotFoundException e){
             System.out.println("Can't open file "+filename+" for reading, please try again.");
             return;
         // read file for 1st time to count the tokens
         String line = null;
         try{ line = fin.readLine();}
         catch(IOException e) {}
         StringTokenizer tk = new StringTokenizer(line);
         while(line!= null){
             try{ line = fin.readLine();}
             catch(IOException e) {}
             //tk = new StringTokenizer(line);
             wordcount += tk.countTokens();
             System.out.println("wordcount = " + wordcount);
         // close file
         try{fin.close();}
         catch(IOException e){
             System.out.println( filename+" close failed");
         // now go through file a second time and copy tokens into the new array
         wrd = new String [wordcount];
            BufferedReader fin2 = null;
            try{ fin2 = new BufferedReader (new FileReader(filename));}
            catch(FileNotFoundException e){
                System.out.println("Can't open file "+filename+" for reading, please try again.");
                return;
            String pop = null;
            try{ pop = fin2.readLine();}
            catch(IOException e) {}
            StringTokenizer tk2 = new StringTokenizer(pop);
         int nextindex = 0;
         while(pop!=null){
             while (tk2.hasMoreTokens()) {
              wrd[nextindex] = tk2.nextToken();
              nextindex++;
             try{ pop = fin2.readLine();}
             catch(IOException e) {}
             //tk2 = new StringTokenizer(pop);
         try{fin2.close();}
         catch(IOException e){
             System.out.println(filename+" close failed");
         for(int k=0;  k<wordcount; k++){
            System.out.println(wrd[k]);
        public void hist() {
            //prints out all the tokens
           words = new String[wordcount];
           count = new int[wordcount];
           //boolean test = false;
               for(int m=0; m<wordcount; m++){
                   if(words.equals(wrd[m])){
                       System.out.print("match");        
                   else{
                       words[m] = wrd[m];
                       count[m] = 1;
        public void show() {
         //shows all the tokens
         for(int j=0; j<wordcount; j++){
              System.out.print(words[j]);
              System.out.print(count[j]);
        public void save() {
            //Write the contents of the entire current histogram to a text file
            PrintWriter out = null;
            try { out = new PrintWriter(new FileWriter("outfile.txt"));}
            catch(IOException e) {}
            for (int i= 0; i<wordcount; i++) {
                out.println(words);
    out.println(count[i]);
    out.close();
    public void help() {
    System.out.println(" This help will tell you what each command will do.");
    System.out.println("");
    System.out.println(" open - this command will open a text file that must be in the same directory ");
    System.out.println(" as the program and scan through it counting how many words it has, ");
    System.out.println("");
    System.out.println(" hist - after you use the open command to open the text file the hist command will ");
    System.out.println(" make a tally sheet counting how many times each word has been used. ");
    System.out.println("");
    System.out.println(" show - after you have opened the file with the open command and created a histogram ");
    System.out.println(" with the hist command the show command will show a portion of or the entire h histogram. ");
    System.out.println("");
    System.out.println(" (show) just by itself will show the entire histogram. ");
    System.out.println("");
    System.out.println(" (show abc) will show the histogram count for the text abc if it exists. ");
    System.out.println(" If the text is not found it will display text not found. ");
    System.out.println("");
    System.out.println(" (show pr*) will show the histogram count for all text items that begin with ");
    System.out.println(" the letters pr, using * as a wild card character. ");
    System.out.println("");
    System.out.println(" save - after you have opened the file with the open command, and created the histogram ");
    System.out.println(" with the hist command the save command will save the contents of the entire current histogram. ");
    System.out.println(" to a text file that you choose the name of. If the file already exists the user will be prompted ");
    System.out.println(" for confirmation on if they want to pick another name or overwrite the file.");
    System.out.println("");
    System.out.println(" quit - will quit the program. " );

    Couple of points to begin with:
    1. Class names should begin with an upper case letter
    2. Class names should be descriptive
    3. You shouldn't call your class main (this kind of follows from the first two points).
    4. Always use {} around blocks of code, it will make your life, and those of the people who have to eventually maintain your code a lot easier.
    5. Never ignore exceptions, i.e. don't use an empty block to catch exceptions.
    6. Avoid assiging a local variable to null, especially if the only reason you are doing it is to "fix" a compilation error.
    7. Your method names should reflect everything that the method does, this should encourage you to break the application logic down into the smallest tasks possible (a general rule is that each method should do one task, and do it well). In the example below, I ignore this advice in the loadFile() method, but it's left as an exercise to you to fix this.
    8. You should use descriptive variable names (fin may make sense now, but will it in 6 months time?), and use camel case where the name uses multiple words, e.g. wordcount should be wordCount
    On the problem at hand, I'll post a cut down example of what you want, and you can look at the javadocs, and find out how it works.
    This code uses the auto-boxing feature of 1.5 (even though I don't like it, again it's left as an exercise for you to remove the auto-boxing ;) ) and some generics (you should be able to work out how to use this code in 1.4).
    import java.io.BufferedReader;
    import java.io.FileNotFoundException;
    import java.io.FileReader;
    import java.io.IOException;
    import java.io.InputStreamReader;
    import java.util.HashMap;
    import java.util.Map;
    import java.util.StringTokenizer;
    public class Histogram {
        /** Map to box the words. */
        private Map<String, Integer> wordMap = new HashMap<String, Integer>();
         * Main method.
         * @param args
         *        Array of command line arguments
        public static void main(String[] args) {
            Histogram h = new Histogram();
            h.menu();
         * Display the menu, and enter program loop.
        public void menu() {
            System.out.println("Welcome to Histogram 1.0");
            BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
            while (true) {
                System.out.println("Please enter one of the following commands: open, hist, show, save, help, or quit");
                String s = null;
                try {
                    s = in.readLine();
                } catch (IOException e) {
                    System.out.println("Unable to interpret the input.");
                    continue;
                if (s.equals("open")) {
                    loadFile();
                } else if (s.equals("quit")) {
                    System.exit(0);
         * Ask the user for a file name and load it
        public void loadFile() {
            System.out.println("Enter Name Of File: ");
            BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
            String filename = null;
            try {
                filename = reader.readLine();
                reader = new BufferedReader(new FileReader(filename));
                loadWords(reader);
                reader.close();
            } catch (FileNotFoundException e) {
                System.out.println("Can't open file " + filename + " for reading, please try again.");
                return;
            } catch (IOException e) {
                System.out.println(filename + " close failed");
            displayHistogram();
         * Load the words from the file into the map.
         * @param reader
        private void loadWords(BufferedReader reader) {
            int wordCount = 0;
            try {
                String line = reader.readLine();
                while (line != null) {
                    StringTokenizer tk = new StringTokenizer(line);
                    wordCount += tk.countTokens();
                    while (tk.hasMoreTokens()) {
                        String next = tk.nextToken();
                        if (wordMap.containsKey(next)) {
                            wordMap.put(next, (wordMap.get(next).intValue() + 1));
                        } else {
                            wordMap.put(next, 1);
                    System.out.println("line: " + line + " word count = " + wordCount);
                    line = reader.readLine();
            } catch (IOException e) {
                System.out.println("Unable to read next line");
         * Display the words and their count.
        private void displayHistogram() {
            System.out.println("Map of words: " + wordMap);
    }

Maybe you are looking for