Making a list of bands

im tryin to make a list of bands using my itunes playlist as the file (i made a txt file copy of it) it goes through like 40 bands and then just stops for some reason....
import java.io.*;
public class Code
     public static void main(String[] args)
          String line="";
          String band="";
          String pband="";
         char a='?';
          int x = 0,ct=0;
          FileReader r = null;
         try {
            r = new FileReader(new File("C:/Documents and Settings/JP/My Documents/My Music/iTunes/bands.txt"));
        catch (IOException e)
            System.out.println("***Hey, file is not a valid file\n what up with that?");
            System.exit(0);
        BufferedReader f = new BufferedReader(r);
        try
             while((line=f.readLine())!=null)
                       for(x=0;x<line.length();x++)
                       if(line.charAt(x)=='A' && line.charAt(x+1)=='r'&& line.charAt(x+2)=='t')
                            x+=20;
                            a=line.charAt(x);
                            pband=band;
                          band="";
                              while(a!='<')
                               band+=a;
                                      x++;
                               a=line.charAt(x);
                                if(!pband.equals(band))
                                     System.out.print(band+", ");
                                break;
         catch (Exception e)
            System.out.println("***Huh!?!?!");
}

Tell me if the following code helps you : import java.io.*;
public class Code {
     public static void main(String[] args) {
          BufferedReader br = null;
          try {
               String band = "";
               String pband = "";
               int leftSeparatorIndex, rightSeparatorIndex;
               br = new BufferedReader(new FileReader("C:/Documents and Settings/JP/My Documents/My Music/iTunes/bands.txt"));
               String line = br.readLine();
               while (line != null) {
                    leftSeparatorIndex = line.indexOf(" - ");
                    if (leftSeparatorIndex != -1) {
                         System.out.print(line);
                         rightSeparatorIndex = line.indexOf("{", leftSeparatorIndex);
                         if (rightSeparatorIndex != -1) {
                              band = line.substring(leftSeparatorIndex, rightSeparatorIndex);
                              if (!pband.equals(band)) {
                                   System.out.print(band + ", ");
                                   pband = band;
                    line = br.readLine();
          } catch (IOException e) {
               e.printStackTrace();
          } finally {
               if (br != null) {
                    try {
                         br.close();
                    } catch (IOException e) {
                         e.printStackTrace();
} If not, you might want to explain exactly the structure of a line of your file (or explain how to obtain such a file. I have itunes but in my attempt to export a playlist to a text file, all I got was some kind of a CSV like file)

Similar Messages

  • Making task list field mandatory in creation of maintenance plan?

    Dear All,
    I need your help in configuration of Making task list field mandatory in creation of maintenance plan. I checked with sceen variant config but that also not giving me any option to make the field mandatory.
    Is there any note or user exit for it?
    Regards,
    Kaushal Rai

    Dear,
    Pls check the exit IPRM0004:Maintenance plan / item: Customer check for time "SAVE".
    Regards
    Sunil

  • Work around / fix for making a list of drop down boxes

    Dear experts,
    When lists are created, its cells act like top-level views. Because of this, everything attempting to go past the border of the list item is clipped. This is a problem when making a list of drop down boxes. Is there a known work around for this or maybe a fix?
    Regards,
    Olivier

    thank you saish, moving 'the artists are' helps visually, as for the fix, i really needed to store it in an arrayList, resultSets aren't very happy about being manipulated!
    here's the fix:
    writer.println("<select name=\"userList\" size=\"1\">");
    ArrayList a = new ArrayList();
    ResultSet r=null;
    // this is just my way of accessing the database and the correct method with the artist names in it
    r = factory.getCustomersDAO().get_Artist_Names_Only();
    while(r.next())
    // retrieve artist names as String variables
    String artist = r.getString("artist_name");
    // add to ArrayList
    a.add(artist);
    for(int i=0; i<a.size(); i++)
    Object art = a.get(i);
    art = (String)art;
    writer.println("<OPTION VALUE=\"" +art+ "\">" art "</OPTION>");
    writer.println("<tr><td colspan = \"2\"><h2>Enter Artist Name to be booked: </h2></tr></td>");
    writer.println("</SELECT></TD></TR>");
    thanks again, i've got another problem now that i'm just about to post about, how to register when one particular cell in a html table has had its link clicked!
    jenxx

  • Hi, recently I have been making a list of songs and now that I have all of the songs that I want my iTunes is telling me to answer security questions that I forget the answers to, is it possible to get rid if this?

    Hi, recently I have been making a list of songs and now that I have all of the songs that I want my iTunes is telling me to answer security questions that I forget the answers to, is it possible to get rid if this?

    Damian_2087 wrote:
    ... I forget the answers... is it possible to get rid if this?
    No.
    Contact iTunes Customer Service and request assistance
    Use this Link  >  Apple  Support  iTunes Store  Contact

  • Making A List of Files or Folders

    Is there anyway of making a list of the files or folders I have if I want to send someone a list of files in a folder - or folders for a particular topic without having to actually send them the files.
    I know I can do a screen shot but I was wondering if there was any shortcut in the system that would create a list.
    Thanks.

    You could just use Terminal and use the command line
    function "ls".  For instance, if you want to list the contents
    of a directory called foo in your home directory type in
    ls ~/foo
    You will get a list of all the files in that directory.  To see
    all the listing options available type
    man ls
    then use the arrow key to scrol through all the display options.
    Then press q to return to the command prompt.
    You can then just select that are with the listing with your
    mouse, copy, and then paste the info into your document.

  • Help making a list of missing/not working features

    Since Adobe isn't talking why not help me make a list of features that aren't in Premiere anymore as well as one's promised for premiere CS4 but aren't there until it's updated.
    No AAF
    No single click save stills - AECS4 still has this
    No more stream hinting in quicktime
    HDV and AVCHD audio synch problems
    Track Matte effect doesn't work
    Media browser doesn't preview 24p correctly,
    XML to Final Cut doesn't work
    No OMF
    No edit with Audition,
    No 3rd party codecs - Cineform, Quicktime dvcproHD, Blackmagic, Raylight
    Have to 'Interpret Footage' for 24p and 24pa
    These just off the top of my head and not bug related issues listed here http://premierepro.wikia.com/wiki/Known_Issues

    Here's another one from November 13th.
    'Good morning one & all,
    We've been cranking out code with the RED team, lining up for the same schedule.
    Next week we'll ship a full native workflow for RED in Premiere Pro CS4, After Effects CS4 and even Encore CS4 (the RED to Blu workflow).
    We've come a long way since the IBC demos --- more performance, more stability, more options, and tuning it to CS4 which is architected for 64 bit systems so that you can stuff it full of memory and get that smooth as butter experience.
    Import your R3D files, change resolution on the fly, pop into full resolution for some detail work, drop all the way down to 1/16th for fast cuts on a laptop --- it's all there.
    We're right up to 2K at full performance with the latest drop.
    Oh, and did I mention that we're working the RED gang on exposing more control on the realtime de-bayering ? ... and of course with Assimilate on making it a full, clean, raw end to end workflow ?
    Expect the importer to be posted with RED and linked from Adobe before Thanksgiving. Nov 20th is looking like the date (not that dates ever change).
    Many thanks to our beta-testers ... you've been awesome turning things around and helping us shape the future.
    It's cool.
    It's Christmas come early.
    Enjoy.'
    Simon & the Merry Adobe Gang
    Keeping you close to the lens

  • Is there a key command for "none" when making a list but I'm finished

    When I am making a numbered list, Pages automatically adds numbers to the next line when I hit "return."
    for example
    1) sdjfskdfdsjdk
    2) ahfghfdghfdhnvbcnbncbv
    3) tereteewtrterwtret
    4)
    In this case, there are only three elements, but Pages goes ahead and thinks I'm going to keep going with the list.
    Is there a key command I can map that will "de-number" the fourth line so I can keep typing without having to go up to the task bar and select "none"?

    Pages User Guide which is also for you claims :
    As pressing return twice doesn't behave well here, I decided to use the second sceme return + delete which works well every time.
    Yvan KOENIG (VALLAURIS, France) jeudi 6 octobre 2011 11:42:45
    iMac 21”5, i7, 2.8 GHz, 4 Gbytes, 1 Tbytes, mac OS X 10.6.8 and 10.7.0
    My iDisk is : <http://public.me.com/koenigyvan>
    Please : Search for questions similar to your own before submitting them to the community

  • Making A List Of Files In A Folder

    Is there a way to make a list of all the files and folders within a root folder? I have thousands of pictures of record label scans in folders by artist name. I'd like to compile a list of some sort of all the folder names and the file names. I tried doing a snapshot of the screen and/or window but it only shows what you see on the monitor not what you would normally need to scroll down to see, which is not many at all. Can anyone please help?? Thanks.

    Hi sjaakad,
    I second eww's thank-you for that tip! I saw eww's reply mentioning TextWrangler and having a little free time for tinkering I downloaded it and tried your suggestion:
    The simplest way is to drag a folder symbol from the Finder into a new BBEdit window
    That's neat stuff! I'm sure I'll find uses for this in the future....thanks again,
    littleshoulders

  • SIMPLE : Making a list from a directory

    Hello, I can't find this on my computer. I have a script that shows all files of the front directory. I need this script but also need the list in text editor
    It(the script) should also watch inside the folder for all files in all subfolders. So I get a list in text editor that i can print. Someone who can help me with this?
    Now i get a menu but I just need to print the list of all files.
    Thanks in advance.
    tell application "Finder"
    set allFiles to the name of every file in the front window
    end tell
    choose from list allFiles

    Hello
    You may try something like the code below.
    It will let you choose the source folder and write list to a file named 'files.txt' in your current destkop.
    --SCRIPT
    set srcdir to POSIX path of (choose folder)
    set outfile to POSIX path of (path to desktop from user domain) & "files.txt"
    set sh to "ls -R " & quoted form of srcdir & " > " & quoted form of outfile
    do shell script sh
    --END OF SCRIPT
    cf.
    http://developer.apple.com/documentation/Darwin/Reference/ManPages/man1/ls.1.htm l
    Hope this may help,
    H
    Message was edited by: Hiroto (fixed code)

  • Making a list of all events in one calendar?

    Is there any way to ask iCal to generate a list of all events and ToDo's from a given calendar?
    iSync doesn't really support multiple calendars when syncing to Palm OS devices: all events created on the Palm are put into one specified calendar (in my case, it's called "FromPalm"). This means I occasionally need to go into iCal and manually move all of the events and tasks in "FromPalm" to whichever calendar they belong in. The problem is: how do I find all of these events, other than by scrolling through my calendar week-by-week looking? If iCal would show me a list -- like it does for search results --, I could just click on them one-by-one and move each to its proper calendar...

    Hi Mike,
    In the calendar list de-select (un-tick) every calendar apart from your "FromPalm" calendar. Click on the Show Search Results buttom (the one with three dots and lines in the lower right of the window), you should have a list of every event in your "FromPalm" calendar.
    To move several of these events to another calendar quickly, Command-Click the events in the list you want put into a particular calendar. Then Control-Click one of the list that you have selected and choose Calendar and then the calendar you have selected. All the events selected should then be moved.
    Best wishes
    John M

  • Pages iWork 08-making a list- font changes

    When I make a list in Pages the font for the numbers and or letters is different than the font I am using. How do I change the font for the list????

    Hello
    As far as I know, there is no way to change that.
    It sounds as a "to add" item in the list of new features I will ask to Apple.
    Yvan KOENIG (from FRANCE samedi 15 décembre 2007 12:18:36)

  • Making xml list with links

    I was able to create a list component in Flash 8 and load the
    items from an
    xml file, but I can't figure out how to make each line
    clickable in order to
    work as a link. The code used to populate the list is:
    form = new Object();
    form.load=xmlConn.trigger();
    The xml file is something like:
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <articles>
    <articles_items>
    <title>Link text 2
    </title>
    <urlstring>article2.htm
    </urlstring>
    </articles_items>
    <articles_items>
    <title>Link text 1
    </title>
    <urlstring>article1.htm
    </urlstring>
    </articles_items>
    </articles>
    I intended to use the second field of each "articles_items",
    the "urlstring"
    field, to associate with each "title" listing on the list
    component, so that
    when "Link text 1" gets clicked it takes to "article1.htm".
    The instances
    created are named articlesList, xmlConn, articles_ds.

    Here is xml code
    <catalogue>
    <sconces>
    <images>
    <image_chemin href="pt/ref115.png"/>
    <image_gd href="gd/ref115.png"/>
    <image_reference>ref : 115</image_reference>
    <image_size>H: 25 in, W: 27 in</image_size>
    </images>
    <images>

  • Need help making a list thing

    I'm trying to make a "friends list" kinda thing. I want to make a scroll bar that scrolls through the friends, and I want it so that each friend makes the list automatically longer.
    I know how to make the scrolling and everything, I just do not know how to make the list get longer per thing in it. How can I do this?

    use a textarea and add your text.  for example:
    yourTA.text = "whatever...";
    yourTA.text += "\nadditional stuff";
    yourTA.text += "\neven more stuff";

  • Making a list of servers

    Hey guys, I was hoping you all would give me you opinion on this. I need to make a list of server that are currently up (For my game).
    I can kind of get it to work by adding the server to the list when I start the program, And I can remove it from the list when the program closes, using LDGraphicsWindow.ExitOnClose But If someone uses task manager and closes the program that way, the
    server will still be on the list.
    I don't know what do do :( 
    Thanks for the help!!
    It is written: "'As surely as I live,' says the Lord, 'every knee will bow before me; every tongue will acknowledge God.'" Romans 14:11

    Not sure i understood right in feverish delir, without knowing your program. But sometimes you can't always get what u want and can't have it all together.
    eg. When i kill my Notepad2, the program can't react anymore (it can' see it coming) and can't save the settings (on closing) anymore.
    There are programs that can watch the state of a program and ev. restart it again, or there are ways to run a program as a service.
    A rather bad idea would be to disable taskmgr (via registry value 'DisableTaskMgr' on program start and perhaps (?) enable it again when the program closes (if all runs fine). But what, if the program crashes, or is killed from the console? Taskmgr stays
    disabled.
    Another exotic idea would be to attach your program as an ADS (alternate data stream) to any other program or file and start it from there. Then it would not be visible in taskmgr anymore.
    eg. in Cmd:
    1.  type yourProg.exe > anyFile.ext:yourProg.exe   (attach yourProg to anyFile)
    2. start anyFile.ext:yourProg.exe   (start yourProg.exe from anyFile.ext hidden)

  • Making a list of user input

    how can i make a list of user input. for instance, i'm asking the user, how many people played. then i take that number and it asks the user that number of times to type a players name. i then want to make a list of those players. i have the repeat operator working correctly, however, it only gets the name of the laset person i typed. help!

    Hi Nana,
    You should create an algorithm, because this script will probably get a lot bigger. You might create subroutines to make things easier. Anyway, here's an example of what you want. Say athe team names are a-f, with a playing b, c playing d, etc.
    set the_winners to {"a", "d", "e"}
    set player_list to {"joe", "sally"}
    set the_picks to {{"a", "d", "f"}, {"b", "c", "f"}}
    set i to 0
    set n to count player_list
    set winning_players to {}
    set high_score to 0
    repeat
    set i to i + 1
    set player_picks to item i of the_picks
    set c to 0
    repeat with this_pick in player_picks
    if (contents of this_pick) is in the_winners then set c to c + 1
    end repeat
    if c > high_score then
    set high_score to c
    set winning_players to {}
    set end of winning_players to (item i of player_list)
    else if c = high_score then
    set end of winning_players to (item i of player_list)
    end if
    if i = n then exit repeat
    end repeat
    {winning_players, high_score}
    About Excel, you could easily get a listing. I'm using Excel X which might not work (scipting wise) with Excel 2004, so that part you can get from somebody else or try it yourself.
    gl,

Maybe you are looking for

  • Need help, motherboard, DK790GX

    Hi. This morning when I turned computer on nothing happend, no beeps, just the fans runing, when turned it of yeasterday there was no problems! Open it and lock for problems, nothing that I could found anyway, next to "clear Bios" there is a text say

  • Query Based Taxonomy and Searching Problem!

    Hi all, Ive an urgent problem to solve .... I create some customs properties with dependent values, for example, if I put Country: Germany, I ve three options, (Waldorf,Munchen,Berlin) and so on ... Then, I create a Query Based Taxonomy, where in som

  • Error - "The data area passed to a system call is too small"

    When I will add the invoice, this error raise in the GetLastErrorDescription of company object... What it's wrong with my code ?     Dim sComp As New SAP.Company     With sComp       .Server = "(local)"       .CompanyDB = "SBODemo_Brazil"       .User

  • Google image search liked navigation script

    Hi! I'm looking for navigation script that would do something like in Google image search, that you can either use side scroll bar to scroll down the thumbnail page, or use mouse wheel for scroll up down. The part that open up extended menu with enla

  • Sound Must come when clicking to linked page

    I am new to Flash. Situation: My buttons have sound attached. Last night, I placed my url to link with my image file for that palette, Fine Art. I targeted 'self' but not sure if that is correct? I want the image file to come within the home page. I