How do I avoid duplicates when adding MP3 folders

I have a folder filled with MP3 songs that I have added to iTunes via the "File > Add Folder to Library" function.
I frequently buy and add additional MP3 songs to that folder (My Music/MP3) and then re-add that folder to iTunes so it adds the additional songs to my library.
Usually, iTunes recognizes that I already have most of those songs and just imports the new ones.  However, if a song that has already been imported before is changed in iTunes (say, for example, you change the artist name from "The Beatles" to "Beatles", then the next time I re-add that same folder to pick up the new songs it also thinks the songs I changed in iTunes are different, new songs and I get a duplicate.
Is there a better way of doing this that results in no duplicates?  I suppose I could keep creating and adding new folders every time I add new songs, but that would get messy fast.
Thoughts?

The default path for the iTunes library folder is C:\Users\<User>\Music\iTunes.
The default path for the media folder is C:\Users\<User>\Music\iTunes\iTunes Media.
Both can be edited; the media folder via Edit > Preferences > Advanced, and the main library path by holding down shift as you start iTunes and using the choose or create library option.
Ideally you want the iTunes Media folder inside the iTunes folder as this puts the library in the portable shape that is easy to move between drives, migrate between computers, and backup.
You can use Edit > Preferences > Advanced > Reset to reset the media folder to the default path inside the library folder, or click the change button if required.
When you change the media folder iTunes should offer to consolidate the library. This makes iTunes make a new copy of any track currently located outside of the media folder inside the media folder and connects the database to that new copy. Once complete it is up to the user to do the house keeping of cleaning up the originals. Alternatively I have another script called ConsolidateByMoving whose purpose should be obvious.
There is another option that controls the internal structure of the library. With new libraries it should be set correctly, but a library that has been migrated from iTunes 8 or earlier might still be in the old shape. If you go to File > Library > Organize Library and find the "Rearrange files..." option is not greyed out then you should tick this and click OK.
See also Grouping tracks into albums.
tt2

Similar Messages

  • How do I avoid duplicates when importing sequences?

    We're doing lots of collaborative editing at our company and just switched from FCP7 to premiere.  We're able to import sequences into projects just fine, but a HUGE problem arises with duplicates.  Each sequence we import brings in new master clips in the Project window, even though all that media already exists in the project.  If I delete it, the media disappears from the sequences that use it. 
    WHY!!!!?
    I assume this is user error.  We're still learning the software and collectively agree that this can't possibly be how Premiere is designed to operate.  What are we doing wrong, and how can we avoid balooning our project files each time we want to consolidate our editors' work?

    While I'm *really* looking forward to seeing the reality of Adobe Anywhere, it currently poses more questions than we have answers for, including how much horse power the server and central storage systems are going to need.  Even for a small shop with 3 edit bays I can see the server becoming pretty sluggish rendering all the frames that need to be sent to the clients, especially once effects are added.  And... what happens when some one decides it's time to export with some plugins that take all the CPU/GPU time up?    And then.... is this going to be included in the next Production Premium or is there going to be a massive premium added on top making it uneconomic for smaller shops?
    Until we know more.... we'll just have to keep editing individually and merging projects as needed.  
    -- back on topic ---
    As I said above, if you are importing projects from other editors it would not normally duplicate the footage.  If it's still doing it then there may be some path issues in the copied project.  In order to 'fix' those issues you can open the copied project they sent first (as a project, not as an import), reconnect all the media to your local media (this is usually just one or two clicks) then save it.   Now go back to your master project and import the sequence as before.  Because your copied project is now already connected to your local media it should not need to duplicate them.
    If it's STILL duplicating footage than perhaps you need to give us more specifics.....

  • How do I avoid duplicates when using "Automatically Add to iTunes"

    I recently consolidated all my music and then created a new library in iTunes. Now I'm using the "Automatically Add to iTunes" folder when I find more music from my archives.
    However, unlike when importing from a CD, iTunes doesn't seem to compare to existing library and detect duplicates in songs in this folder; it just adds them to iTunes. So I am ending up with dups. Is there any way to avoid this?
    Specs: Mac Mini running OSX 10.8.5; iTunes v. 12.0.1.26

    See this Apple support document.
    http://support.apple.com/kb/ht1751
    B-rock

  • How do i avoid duplicate data when synching iphone and mac book to the cloud?

    When I left my job for the last time I uploaded my Microsoft Outlook Contacts to the Cloud so that I could synch it with my Iphone (which I did).  Now I would like to also synch the Address Book on my Macbook  with the Cloud and my Iphone so I can integrated all of these contacts.  First I do not know if I can do this since my MACbook is a few years old aand I do not see the Cloud Icon anywhere on it.   Second of all I am not sure which area (Cloud, Iphone, or Macbook) take precedence when synching.   Can I lose data?  Does one systems dat over ride the other?  How can I avoid duplicate data?    I am a fairly new Mac user and  love the way things are integrated so I think I should not worry but I need help.  thanks, tdag55

    Hi meadowD,
    If you are looking to remove duplicate files from iTunes, you may find the following article useful (in the most recent versions of iTunes 11, the Display/Show Duplicate Items option has been moved to the View menu):
    Apple Support: How to find and remove duplicate items in your iTunes library
    http://support.apple.com/kb/ht2905
    Cheers,
    - Brenden

  • How can I avoid duplicates on contacts and how do I get contacts created on iPhone/ipad synchronized on my mac? so far it doesn't work correctly, just sometimes. same for icalendar

    how can I avoid duplicates on contacts and how do I get contacts created on iPhone/ipad synchronized on my mac? so far it doesn't work correctly, just sometimes. same for icalendar

    On your Mac, for duplicates, switching Contacts off then back on in System Preferences > iCloud may prevent duplicates.
    On the iPhone / iPad tap Settings > iCloud. Make sure Contacts and Calendars are swtiched on.
    Try restarting your Mac and your iOS devices when items won't sync as they should.
    To restart an iOS device:  Hold the On/Off Sleep/Wake button down until the red slider appears. Slide your finger across the slider to turn off iPhone. To turn iPhone back on, press and hold the On/Off Sleep/Wake button until the Apple logo appears.

  • How do I avoid duplicates after signing back in to my current iCloud account on my iPad?

    I had to delete my newer iCloud account and sign in to the App store with my old AppleID to download missing apps on my first generation iPad. I did not delete Contacts or Calendar entries when I deleted the newer account so the data is still on my iPad. After I updated the apps I deleted the old account and signed on again with my newer account. I did not allow any data to merge when I signed in with either account. My question is: if I turn on Contacts and Calendar will the data duplicate? If so how can I avoid that happening? (I hope I explained this clearly enough)

    Having just changed my Apple ID to separate myself from my son who was sharing my ID I can tell you how to handle this in IOS7.  I went to the Apple web site and established my new ID.
    I followed the advice on this support page to change my Apple ID  Change your Apple ID - Apple Support
    I then followed the advice on this page to update the ID on my device Sign in with a different Apple ID on your iPhone, iPad, or iPod touch - Apple Support
    IMPORTANT!!!! When you delete your iCloud for your old Apple ID off your phone you will lose all your documents that are in the cloud but not your contacts that are out in the cloud.  Also, before following the directions on the"Sign in with a Different Account" page to delete the iCloud Apple ID first turn off iCloud sync on each item individually.  When you turn off the sync it will ask you if you want to keep the data on your phone.  Yes you do want this.  After turning off sync individually Delete the iCloud account for the old Apple ID.  Then when you then sign into iCloud with your new Apple ID select the Merge option and it will upload all your contacts and data to the iCloud account for your new Apple ID.
    If you simply Delete your iCloud account it will delete all your contacts off your phone.  If you delete iCloud without first turning sync off Contacts and your contacts are then deleted off your phone, don't worry.  Simply log back into iCloud with your old account and your contacts will be restored.  Then you can turn off the sync on all items, Delete the old account from iCloud, sign in with the new apple Id, select Merge iPhone data.  So it puts your contacts and data from your phone into your new iCloud account.

  • How do I "avoid" duplicate calendar entries on my devices?

    I have an iPod touch, an iPhone 4, an iPad 2 and a MacBook Pro running OS X 10.8.2.  My software/IOS is up to date on all devices.  My main calendar is my Google Calendar.  Whenever I sync, my devices show multiple double calendar entries.  Now, I have found a large amount of information on removing the duplicate entries which has been helpful.  However, I am having difficulty finding an answer as to how to eliminate this in the future.  What I want is to be able to go into iCal, on any of my devices, and see the same calendar (which it appears I currently can) without ever having double entries for the same events.  How do I need to have it set up?  Yes, I have searched ad nauseum; but, I can't find my answer.  Maybe I am just incompetent.  Any help and/or guidance would be greatly appreciated.

    O.K., first, thanks for the response Mistimp.  Here is my specific situation, my google calendar is my "main" calendar and is what populates iCal.  I hope that makes sense.  I want to be able to make calendar entries on any device either in iCal or Google.  I believe I can do that.  I'll have to check further.  If I'm not mistaken, the duplicate entries show up every time I sync.  Then, I have to go through the process of turning off a calendar and then re adding it. I want to avoid that step and just avoid duplicate entries forever.

  • How to add default values when adding custom component to design view?

    I have a set of custom components (usually) extending Spark components. But when adding our custom component onto design view, how can I define defult values (in AS3).
    For example, s:Button has default label = 'Button' when added to application, or mx:DataGrid has 3 columns predefined, but when using custom components there are no predefined values like this.
    I can put this values in constructor, but they are not visible in design time, only runtime.
    Any ideas? Thanks
    Esmin

    yes, I am. By the way I've found the solution. Someone might find this usefull.
    In design.xml having
    <component name="ExtendedTextInput" namespace="mynamespace" category="beta" displayName="ExtendedTextInput"/>
    use this
    <component name="ExtendedTextInput" namespace="mynamespace" category="beta" displayName="ExtendedTextInput">
            <defaultAttribute name="text" value="ExtendedTextInput"/>
        </component>
    so when adding this component to design view, it will have text setted to value ('ExtendedTextInput' in this case).

  • How do I avoid duplicates importing with dvd's?

    I just bought my Mac, and love it! I am learning as I go, and so far everything has been very straightforward. I previously had a home PC where I stored all of my photos using Picasa. Short story, all became scrambled (1.000's of pics), and was totally unable to fix it. I do have dvd's with the correct content that I would like to import, but several have duplicate photos. Every time I try, I see duplicates in my library. This would amount to 100's of duplicates. Is there a shortcut? I see that "avoid duplicates" is an option with cameras and other devices, but cannot figure out how this works with DVD's. I am very frustrated, and have spent hours and hours trying to get it right. Could anyone please give me some advice? I would be so appreciative!!! Thank You!!!

    Purchase and run Duplicate Annihilator - http://brattoo.com/propaganda/ - on your iPhoto library
    LN

  • I am having problems when adding mp3

    So when I sync the whole ipod touch, it's fine, but when I try to sync music or manually add music, i get some error windows.
    When I first got the ipod in Jan2010, it was fine when I manually added mp3s, but recently I tried to add more music, it wouldn't allow me to.
    I tried restoring to factory settings and restore from my back up, it didn't help.
    I disabled my anti-virus (CA), still having trouble adding mp3s manually or syncing.
    Everything else related to syncing works.
    I tried my other ipods for this current PC and I was able to add music to those, but still not with the ipod touch.
    http://sehanafortress.com/help/ipoderrors_201005may0001.jpg
    http://sehanafortress.com/help/ipoderrors_201005may0002.jpg
    http://sehanafortress.com/help/ipoderrors_201005may0003.jpg
    http://sehanafortress.com/help/ipoderrors_201005may0004.jpg
    http://sehanafortress.com/help/ipoderrors_201005may0005.jpg
    Windows XP
    iTunes 9.1.1.12
    ipod touch 3.1.3
    Thank You
    Message was edited by: sehana

    Many thanks.
    Okay ... swinging into "basic principles" troubleshooting mode. I'm suspecting most strongly either a damaged pref file or library file here. If that's what is going on, then these errors should be specific to a single Windows user account on the PC (because there's a different set of iTunes preferences files and library files for each different Windows user account on the PC).
    So I'd like to do a little experiment to check to see if this is a user account specific or system-wide problem on the PC.
    Quit iTunes if you have it open. Head into your User accounts control panel. Create a new user account with full administrative rights.
    Now log out of your usual user account and log into the new account. (Don't use fast user switching to move between accounts.)
    Launch iTunes in the new user account. The iTunes set-up assistant will run. Don't add any files to iTunes when prompted to do so ... just let iTunes eventually launch to an empty library.
    Now in iTunes go "Edit > preferences". Click the Devices tab. Make sure the "Prevent iPods, iPhones and iPads from syncing automatically" checkbox is checked and then click OK.
    Now add a small number of mp3 to the new empty library. (Preferably, make them files that have transfered successfully to the ipod in the past.)
    Now try attaching the iPod. Do not associate the iPod with the empty library. Now try checking that "manually manage" setting.
    Attempt to do a manual transfer of the mp3s to the iPod from the new library. Do they transfer across without the error messages?
    Now add a small number of the files that haven't synced successfully to the iPod (in the usual user account) to the iTunes library in the new account. Again, try a manual transfer of some of those files to the iPod. Do those transfer without the error messages?
    (If both types of manual transfers take place without errors in the new account, that strongly suggests we should try to fix any library file or pref file issue in the usual account. If just the new mp3s refuse to transfer, then I'd be suspicious about a problem with the files themselves. If both types of files refuse to transfer, that would tend to rule out a library file or pref file issue, and we'll start checking on other possible causes of the issues.)

  • How to Given the Message when Adding the Marketing Documents

    Hello Experts,
    I have Required only Message for when Adding the Markeing Documents that times
    I want give the message for  " Please Check the Control Account"
    Is IT Possibal  in SAP
    Dixit Patel

    Hello Dixit Patel,
    It is possible but that need SDK coding.
    Thanks,
    Gordon

  • How to avoid Flickaring  When Adding data in Addon User Matrix

    Experts,
    I am  Adding Query Result in User Matrix  one by one. but there is lots of Flicker.
    how to Avoid this Flickering.
    Bomiitems = oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoRecordset)
                                    If Bomtyp = "U" And BomNo = "0" Then
                                        BOMItem = "SELECT Distinct T0.[Code], T1.[ItemName] , ( 1 / Isnull(T2.[Qauntity],0))* Isnull((T0.[Quantity]),0),('" & Quanti & "'/ Isnull(T2.[Qauntity],0))* Isnull((T0.[Quantity]),0) as "
                                        BOMItem = BOMItem + " 'Quanti',T1.[Excisable],'N' as U_Rec , T1.[InvntryUom],T0.[Warehouse] 'Warehouse',T0.[IssueMthd]'IssMthd' FROM ITT1 T0  INNER JOIN OITM T1 "
                                        BOMItem = BOMItem + " ON T0.Code = T1.ItemCode  INNER JOIN OITT T2 ON T0.Father = T2.Code "
                                        BOMItem = BOMItem + " WHERE T0.[Father] ='" & Icode & "'"
                                        Bomiitems.DoQuery(BOMItem)
                                    ElseIf Bomtyp = "U" And BomNo <> "0" Then
                                        'BOMItem = "SELECT T0.[Code], T1.[ItemName] , ((T0.[Quantity]/ T2.[Qauntity])*'" & Quanti & "') as 'Quanti',T1.[Excisable],'N' as U_Rec FROM ITT1 T0  INNER JOIN OITM T1 ON T0.Code = T1.ItemCode  INNER JOIN OITT T2 ON T0.Father = T2.Code WHERE T0.[Father] ='" & Icode & "'"
                                        BOMItem = "SELECT T1.[U_Icode], T1.[U_IName],(1 / Isnull(Cast( T0.[U_Bqty]  as Float) ,0)) * Isnull(Cast(T1.[U_Quanti]  As Float),0) ,('" & Quanti & "' / Isnull(Cast( T0.[U_Bqty]  as Float) ,0)) * Isnull(Cast(T1.[U_Quanti]  As Float),0)  as 'Quanti',T2.[Excisable], T0.[U_Rec],T2.[InvntryUom] ,T1.[U_Whs] 'Warehouse','B' AS 'IssMthd' "
                                        BOMItem = BOMItem + "FROM [dbo].[@OITTA]  T0 inner join  [dbo].[@ITTA1]  "
                                        BOMItem = BOMItem + "T1 on t0.cODE = t1.Code INNER JOIN OITM T2 ON  T1.[U_Icode] = T2.[ItemCode]"
                                        BOMItem = BOMItem + " WHERE T0.[U_Icode] = '" & Icode & "' AND   T0.[U_AltBom] ='" & BomNo & "' AND T0.U_Btyp = 'U'  "
                                        Bomiitems.DoQuery(BOMItem)
                                    ElseIf Bomtyp = "P" Then
                                        BOMItem = "SELECT T1.[U_Icode], T1.[U_IName],(1 / Isnull(Cast( T0.[U_Bqty]  as Float) ,0)) * Isnull(Cast(T1.[U_Quanti]  As Float),0),('" & Quanti & "' / Isnull(Cast( T0.[U_Bqty]  as Float) ,0)) * Isnull(Cast(T1.[U_Quanti]  As Float),0)  as 'Quanti',T2.[Excisable], T0.[U_Rec] ,T2.[InvntryUom],T1.[U_Whs] 'Warehouse','B' AS 'IssMthd' "
                                        BOMItem = BOMItem + "FROM [dbo].[@OITTA]  T0 inner join  [dbo].[@ITTA1]  "
                                        BOMItem = BOMItem + "T1 on t0.cODE = t1.Code INNER JOIN OITM T2 ON  T1.[U_Icode] = T2.[ItemCode]"
                                        BOMItem = BOMItem + " WHERE T0.[U_Icode] = '" & Icode & "' AND   T0.[U_AltBom] ='" & BomNo & "' AND T0.U_Btyp = 'P' "
                                        Bomiitems.DoQuery(BOMItem)
                                    End If
                                        Bomiitems.DoQuery(BOMItem)
                                    If Bomiitems.RecordCount > 0 Then
                                        'RecCount1 = RecSet1.RecordCount
                                        Bomiitems.MoveFirst()
                                        i = 0
                                        'osubForm   .Freeze(True)
                                        oMatrix = oForm.Items.Item("1000001").Specific
                                        oMatrix.FlushToDataSource()
                                        While Not (Bomiitems.EoF)
                                            If i = 0 Then
                                                oMatrix.AddRow()
                                                oForm.DataSources.DBDataSources.Item("@TPROD1").SetValue("LineId", 0, i + 1)
                                                oForm.DataSources.DBDataSources.Item("@TPROD1").SetValue("U_ItemCode", 0, Bomiitems.Fields.Item(0).Value)
                                                oForm.DataSources.DBDataSources.Item("@TPROD1").SetValue("U_ItemName", 0, Bomiitems.Fields.Item(1).Value)
                                                oForm.DataSources.DBDataSources.Item("@TPROD1").SetValue("U_BaseQty", 0, Bomiitems.Fields.Item(2).Value)
                                                oForm.DataSources.DBDataSources.Item("@TPROD1").SetValue("U_PlanQty", 0, Bomiitems.Fields.Item(3).Value)
                                                oForm.DataSources.DBDataSources.Item("@TPROD1").SetValue("U_IssueQty", 0, Bomiitems.Fields.Item(3).Value)
                                                oForm.DataSources.DBDataSources.Item("@TPROD1").SetValue("U_Whs", 0, Bomiitems.Fields.Item("Warehouse").Value)
                                                oForm.DataSources.DBDataSources.Item("@TPROD1").SetValue("U_IsueType", 0, Bomiitems.Fields.Item("IssMthd").Value)
                                                Dim orsWhsDetails As SAPbobsCOM.Recordset
                                                Dim strWhsDetails As String
                                                orsWhsDetails = oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoRecordset)
                                                strWhsDetails = "SELECT T0.[OnHand], T0.[IsCommited], T0.[OnOrder],T1.[OnHand] FROM OITW T0 INNER JOIN OITM T1 ON T0.ItemCode = T1.ItemCode WHERE T0.[ItemCode] ='" & Bomiitems.Fields.Item(0).Value & "' AND   T0.[WhsCode] ='" & Bomiitems.Fields.Item("Warehouse").Value & "' "
                                                orsWhsDetails.DoQuery(strWhsDetails)
                                                oForm.DataSources.DBDataSources.Item("@TPROD1").SetValue("U_Whsestk", 0, orsWhsDetails.Fields.Item(0).Value)
                                                oForm.DataSources.DBDataSources.Item("@TPROD1").SetValue("U_AVILSTK", 0, (orsWhsDetails.Fields.Item(0).Value - Bomiitems.Fields.Item(3).Value))
                                                oForm.DataSources.DBDataSources.Item("@TPROD1").SetValue("U_PLANTSTK", 0, orsWhsDetails.Fields.Item(3).Value)
                                                oMatrix.LoadFromDataSource()
                                            Else
                                                oMatrix.FlushToDataSource()
                                                oForm.DataSources.DBDataSources.Item("@TPROD1").InsertRecord(i)
                                                oForm.DataSources.DBDataSources.Item("@TPROD1").SetValue("LineId", i, i + 1)
                                                oForm.DataSources.DBDataSources.Item("@TPROD1").SetValue("U_ItemCode", i, Bomiitems.Fields.Item(0).Value)
                                                oForm.DataSources.DBDataSources.Item("@TPROD1").SetValue("U_ItemName", i, Bomiitems.Fields.Item(1).Value)
                                                oForm.DataSources.DBDataSources.Item("@TPROD1").SetValue("U_BaseQty", i, Bomiitems.Fields.Item(2).Value)
                                                oForm.DataSources.DBDataSources.Item("@TPROD1").SetValue("U_PlanQty", i, Bomiitems.Fields.Item(3).Value)
                                                oForm.DataSources.DBDataSources.Item("@TPROD1").SetValue("U_IssueQty", i, Bomiitems.Fields.Item(3).Value)
                                                oForm.DataSources.DBDataSources.Item("@TPROD1").SetValue("U_Whs", i, Bomiitems.Fields.Item("Warehouse").Value)
                                                oForm.DataSources.DBDataSources.Item("@TPROD1").SetValue("U_IsueType", i, Bomiitems.Fields.Item("IssMthd").Value)
                                                Dim orsWhsDetails As SAPbobsCOM.Recordset
                                                Dim strWhsDetails As String
                                                orsWhsDetails = oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoRecordset)
                                                strWhsDetails = "SELECT T0.[OnHand], T0.[IsCommited], T0.[OnOrder],T1.[OnHand] FROM OITW T0 INNER JOIN OITM T1 ON T0.ItemCode = T1.ItemCode WHERE T0.[ItemCode] ='" & Bomiitems.Fields.Item(0).Value & "' AND   T0.[WhsCode] ='" & Bomiitems.Fields.Item("Warehouse").Value & "' "
                                                orsWhsDetails.DoQuery(strWhsDetails)
                                                oForm.DataSources.DBDataSources.Item("@TPROD1").SetValue("U_Whsestk", i, orsWhsDetails.Fields.Item(0).Value)
                                                oForm.DataSources.DBDataSources.Item("@TPROD1").SetValue("U_AVILSTK", i, (orsWhsDetails.Fields.Item(0).Value - Bomiitems.Fields.Item(3).Value))
                                                oForm.DataSources.DBDataSources.Item("@TPROD1").SetValue("U_PLANTSTK", i, orsWhsDetails.Fields.Item(3).Value)
                                                oMatrix.LoadFromDataSource()
                                            End If
                                            i = i + 1
                                            Bomiitems.MoveNext()
                                            oMatrix.LoadFromDataSource()
                                        End While
                                        oMatrix.LoadFromDataSource()
                                    End If
    Regards,
    Pravin Baji

    follow steps
    1)     Execute query so we can get data set
    2)     Clear matrix and data source (omatrix.clear(), oDBS.Clear())
    3)     Open loop
    4)     Insert record to oDBS using oDBS.InsertRecords(oDBS.Offset)
    5)     Then set value using oDBS.Setvalue(u2026u2026
    6)     Move next record
    7)     Finally close the loop
    8)     Matrix load from record set using oMatrix.LoadfromData()
    it will be work

  • When syncing my calendar with my iMac how to I avoid duplicate display?

    When syncing calendar entries between my ipod and iMac, duplicate entries show on the ipod.   Duplication does not appear on the computer.

    Maybe:
    https://discussions.apple.com/message/20311989#20311989
    Ths also may help
    iCloud: Advanced Calendar and iCal troubleshooting

  • How to avoid duplicates when writing a file

    Hai all,
    I wrote a jsp program which generates html files dynamically taking particular keyword and category. In the same program i am also writing the links in xml file i.e page location (href). I page will call everday once. for the first time it is adding once if that page was called on second day it is adding agin those links are adding twice to that xml,even if those links are present in that xml file. but i need if the link is present in that xml file then it does not write again in that xml file for that i put the condition but is giving error.
    Here i am putting my xml file
    <?xml version="1.0" encoding="UTF-8"?>
    <urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
    <url>
    <loc>http://localhost:8080/Links/debt_get out of debt plan.html</loc>
    <priority>0.6</priority>
    <changefreq>weekly</changefreq>
    </url>
    <url>
    <loc>http://localhost:8080/Links/debt_no to debt.html</loc>
    <priority>0.6</priority>
    <changefreq>weekly</changefreq>
    </url>
    <url>
    <loc>http://localhost:8080/Links/sports_football.html</loc>
    <priority>0.6</priority>
    <changefreq>weekly</changefreq>
    </url>
    </urlset>>
    below i am putting my java code
    import java.io.*;
    class FileReadTest {
    public static void main (String[] args) {
         FileReadTest f = new FileReadTest();
    f.readMyFile();
    void readMyFile() {
    DataInputStream dis = null;
    String record = null,r=null;
    int recCount = 0;
    try {
    File f = new File("MyXMLFile.xml");
    FileInputStream fis = new FileInputStream(f);
    BufferedInputStream bis = new BufferedInputStream(fis);
    dis = new DataInputStream(bis);
    while ( (record=dis.readLine()) != null )
    recCount++;
                   r=record;
    //System.out.println(recCount + ": " + record); //compareTo
              String sb=r.toString();
              int l =0;
              boolean b=sb.contains("http://localhost:8080/Links/debt_no to debt.html");
                   // l =sb.indexOf("http://www.abacapital.com/privacy/?action=print");
                   l =sb.indexOf("http://localhost:8080/Links/debt_no to debt.html");
              System.out.println(b);
    if(l!=-1)
                             System.out.println("This is equla " +l);
                        else{
                        System.out.println("Not equal");}
    } catch (IOException e) {
    // catch io errors from FileInputStream or readLine()
    System.out.println("Uh oh, got an IOException error!" + e.getMessage());
    } finally {
    // if the file opened okay, make sure we close it
    if (dis != null) {
         try {
    dis.close();
         } catch (IOException ioe) {
    error what i am getting is
    false
    Not equal
    plese help me to solve this problem. I donot want to write second time if that link was already present in that. If link was not in that file then it has to write that link in that file.

    while ( (record=dis.readLine()) != null )
       recCount++;
       r=record;
       //System.out.println(recCount + ": " + record); //compareTo
    String sb=r.toString();
    int l =0;
    boolean b=sb.contains("http://localhost:8080/Links/debt_no to debt.html");
    // l =sb.indexOf("http://www.abacapital.com/privacy/?action=print");
    l =sb.indexOf("http://localhost:8080/Links/debt_no to debt.html");
    System.out.println(b);I think the contains and indexOf checks should be done within the loop for each line; the way it is written above, i think the loop finishes after reading all the lines which means r always contains the last line. Which means the check is always made for the last line.

  • How can I avoid duplicates on importing ics files

    I'm a new Mac user and would like to start using the Mac for everything including my diary.
    For a while I will be working in parallel with another calendar (I'm using the Lightning add-in to Thunderbird).
    Scenario as follows:
    Export events from Lightning in ics format.
    Import into iCal - works fine.
    The Lightning calendar is updated - events added and updated and then re-exported.
    When I import again into iCal, instead of updating events previously imported, duplicate events are created.
    This appears to be because iCal is assigning a new UID to every event that it imports. If iCal used the UID defined in the input stream, it would work fine.
    The iCal standard (RFC2446 http://tools.ietf.org/html/rfc2446 ) states:
    CUAs must persist the following component properties: "UID", "RECURRENCE-ID", "SEQUENCE", and "DTSTAMP".
    If iCal is not persisting the UID, then it would appear to be breaking the iCalendar Transport-Independent Interoperability Protocol as defined in the referenced RFC.
    Is there a workaround or any hope that iCal might be fixed to comply with the standard?
    Thanks

    On your Mac, for duplicates, switching Contacts off then back on in System Preferences > iCloud may prevent duplicates.
    On the iPhone / iPad tap Settings > iCloud. Make sure Contacts and Calendars are swtiched on.
    Try restarting your Mac and your iOS devices when items won't sync as they should.
    To restart an iOS device:  Hold the On/Off Sleep/Wake button down until the red slider appears. Slide your finger across the slider to turn off iPhone. To turn iPhone back on, press and hold the On/Off Sleep/Wake button until the Apple logo appears.

Maybe you are looking for

  • How do I share several contacts from one iCloud account to another?

    How do I share several contacts from one iCloud account to another iCloud account?

  • Oprah podcasts still pause during playback

    Quite a while ago I asked about the weird hesitation during playback of any of the Oprah podcasts, but, although several people reported having the same experience, no one had an answer. Well....thought I'd bring the subject up again and see if there

  • How do i know when my maps are out of date?

    is there an eas way to tell when i should be updating my maps on my n95 8GB, without waiting until it tries to take me down a road that no longer exists etc...?

  • Having problems copying an image

    I'm having problems copying an image. The Image comes from my jar file and I'm trying to copy it to my hard drive. The problem is that it seems to add extra characters at the beggining and maybe at the end as well. I used a Hex Editor to compare the

  • HT201272 Where are the icons?

    I can't see any icons on the "purchased" page of the App Store on my iPad. However, I can tap into those apps from that page. How can I get the icons appear again?