Trying to ignore spaces when comparing strings

I am writing a program where an answer entered by a user is compared to an answer held in a database. I have got it working but I can't get it to ignore 'spaces' or 'carriage returns'. Please can you have a look at my code and let me know what I can do to get this working.
Thanks in advance
Jes
public class DBHandler {
public DBHandler(String aQuestNum, String studentAnswer) {
JOptionPane jop = new JOptionPane();
JOptionPane jop2 = new JOptionPane();
try {
DriverManager.registerDriver(new sun.jdbc.odbc.JdbcOdbcDriver());
Connection aConnection = DriverManager.getConnection("jdbc:odbc:EnquiryTest", "", "");
Statement aStatement = aConnection.createStatement();
ResultSet aSet = aStatement.executeQuery ("SELECT * FROM EnquiryTestTable2 WHERE questionNum = '" + aQuestNum +"'");
while (aSet.next()) {
String tutorAnswer = aSet.getString("TAnswer");
int test = tutorAnswer.compareTo(studentAnswer);
if(test == 0)
jop2.showMessageDialog(null,"Right Answer Well Done!");
else
jop.showMessageDialog(null,"Wrong Answer Try Again!");
aConnection.close();
catch (SQLException e) { System.exit(9);}
}

My suggestion is to loop through the student answer ( make a copy of it if you need it for other purposes ) and remove all the spaces and carriage returns and then compare them. Here's an example:
StringBuffer tempBuffer( studentAnswer );
while( tempBuffer.indexOf( " " ) != -1 )
tempBuffer.deleteCharAt( tempBuffer.indexOf( " " ) );
You could use this to also check for newline characters \t and carriage returns ( not sure what ascii character is used for that ). Also the String method .trim() will remove all whitespace before and after the string ( but not say, spaces between words ).

Similar Messages

  • [svn:bz-trunk] 21292: Fix BLZ-639 - avoid the use of "==" when comparing strings.

    Revision: 21292
    Revision: 21292
    Author:   [email protected]
    Date:     2011-05-25 12:09:39 -0700 (Wed, 25 May 2011)
    Log Message:
    Fix BLZ-639 - avoid the use of "==" when comparing strings.  Just check for null explicitly.
    Ticket Links:
        http://bugs.adobe.com/jira/browse/BLZ-639
    Modified Paths:
        blazeds/trunk/modules/common/src/flex/messaging/config/ClientConfiguration.java

    Adobe has donated BlazeDS to the Apache Flex community, and the source code is hosted on the Apache Flex website in a GIT repository.
    http://flex.apache.org/dev-sourcecode.html

  • "java.lang.OutOfMemoryError: Java heap space" when comparing files

    Hi,
    I need to take differences between the existing jazn-data.xml and the jazn-data.xml file downloaded from ADR and keep only the required changes. For this, I copied the contents of the new jazn file into the existing one and then tried to use the history tab to compare.
    But I am encountering this error always
    Exception in thread "main" java.lang.OutOfMemoryError: Java heap space
         at oracle.javatools.compare.algorithm.sequence.SequenceCompareAlgorithm.getDifferences(SequenceCompareAlgorithm.java:153)
         at oracle.javatools.compare.algorithm.sequence.SequenceCompareAlgorithm.compare(SequenceCompareAlgorithm.java:55)
         at oracle.javatools.compare.CompareModelFactory.createCompareModel(CompareModelFactory.java:116)
         at oracle.diffmergevhv.diffmerge.DiffMergeView.openImpl(DiffMergeView.java:949)
         at oracle.diffmergevhv.ToolView.open(ToolView.java:310)
         at oracle.diffmergevhv.ToolMain.openView(ToolMain.java:493)
         at oracle.diffmergevhv.ToolMain.executeGUI(ToolMain.java:146)
         at oracle.diffmergevhv.ToolMain.execute(ToolMain.java:91)
         at oracle.diffmergevhv.diffmerge.DiffMergeTask.execute(DiffMergeTask.java:23)
         at oracle.diffmergevhv.diffmerge.DiffMergeMain.main(DiffMergeMain.java:344)
    i tried changing the user memory env setup also but didn't work. I am using 12gb memory slc machine
    " setenv USER_MEM_ARGS "-XX:CompileThreshold=8000 -XX:PermSize=96m -XX:MaxPermSize=2048m -Xms128m -Xmx8192m "
    I also tried the "ade diff -gui " command but the problem remains the same.
    The file sizes are:
    existing jazn: 2.2 MB
    new jazn : 3.4 MB
    Thanks,
    Mehul

    The way i do is..
    setenv ADE_MERGE_METHOD tkmerge
    use the ade diff -gui command
    then unset the ADE_MERGE_METHOD to default by using the following.
    unsetenv ADE_MERGE_METHOD
    Thanks,
    Venu

  • Weird plan when comparing strings in a where clause

    Hi,
    I would like to understand what happens in the following queries. It contains a spatial operator and a spatial index, but it isn't relevant.
    FIRST CASE - compare a varchar2 field equality (bold)
    select /*+ INDEX(t1 FIRST_TABLE_SPATIAL_INDEX) */ t1.rowid rid1,t2.rowid rid2, SDO_NN_DISTANCE(1) dist
    from dbti.FIRST_TABLE t1,dbti.FIRST_TABLE t2,dbti10.SECOND_TABLE w
    where w.r2='AAAkBmAAEAAAmbrAAE' and w.r1=t1.rowid and t1.cr01_idobj<>t2.cr01_idobj
    and t1.MY_FIELD IN ('plant','house')
    and t2.MY_FIELD IN ('plant','house')
    and  t1.MY_FIELD = t2.MY_FIELD
    and sdo_nn(t2.GEOMFIELD,t1.GEOMFIELD,'sdo_num_res=5', 1)='TRUE'
    In this case the plan is a full scan on both the FIRST_TABLEs, and doesn't use the spatial index as required in the hint.
    SECOND CASE: the equality is checked using <= and >=
    select /*+ INDEX(t1 FIRST_TABLE_SPATIAL_INDEX) */ t1.rowid rid1,t2.rowid rid2, SDO_NN_DISTANCE(1) dist
    from dbti.FIRST_TABLE t1,dbti.FIRST_TABLE t2,dbti10.SECOND_TABLE w
    where w.r2='AAAkBmAAEAAAmbrAAE' and w.r1=t1.rowid and t1.cr01_idobj<>t2.cr01_idobj
    and t1.MY_FIELD IN ('plant','house')
    and t2.MY_FIELD IN ('plant','house')
    and  t1.MY_FIELD <= t2.MY_FIELD and  t1.MY_FIELD >= t2.MY_FIELD
    and sdo_nn(t2.GEOMFIELD,t1.GEOMFIELD,'sdo_num_res=5', 1)='TRUE'
    in this case the spatial index is correctly used, and the query executes with the expected performance.
    QUESTION: why the equality operator causes the index not being used? And why the second case works?
    thanks,
    giovanni

    user4069996 wrote:
    Hi,
    I would like to understand what happens in the following queries. It contains a spatial operator and a spatial index, but it isn't relevant.
    FIRST CASE - compare a varchar2 field equality (bold)
    select /*+ INDEX(t1 FIRST_TABLE_SPATIAL_INDEX) */ t1.rowid rid1,t2.rowid rid2, SDO_NN_DISTANCE(1) dist
    from dbti.FIRST_TABLE t1,dbti.FIRST_TABLE t2,dbti10.SECOND_TABLE w
    where w.r2='AAAkBmAAEAAAmbrAAE' and w.r1=t1.rowid and t1.cr01_idobj<>t2.cr01_idobj
    and t1.MY_FIELD IN ('plant','house')
    and t2.MY_FIELD IN ('plant','house')
    and  t1.MY_FIELD = t2.MY_FIELD
    and sdo_nn(t2.GEOMFIELD,t1.GEOMFIELD,'sdo_num_res=5', 1)='TRUE'
    In this case the plan is a full scan on both the FIRST_TABLEs, and doesn't use the spatial index as required in the hint.
    SECOND CASE: the equality is checked using <= and >=
    select /*+ INDEX(t1 FIRST_TABLE_SPATIAL_INDEX) */ t1.rowid rid1,t2.rowid rid2, SDO_NN_DISTANCE(1) dist
    from dbti.FIRST_TABLE t1,dbti.FIRST_TABLE t2,dbti10.SECOND_TABLE w
    where w.r2='AAAkBmAAEAAAmbrAAE' and w.r1=t1.rowid and t1.cr01_idobj<>t2.cr01_idobj
    and t1.MY_FIELD IN ('plant','house')
    and t2.MY_FIELD IN ('plant','house')
    and  t1.MY_FIELD <= t2.MY_FIELD and  t1.MY_FIELD >= t2.MY_FIELD
    and sdo_nn(t2.GEOMFIELD,t1.GEOMFIELD,'sdo_num_res=5', 1)='TRUE'
    in this case the spatial index is correctly used, and the query executes with the expected performance.
    QUESTION: why the equality operator causes the index not being used? And why the second case works?
    thanks,
    giovanniThe queries you are comparing are not logically equivalent. The reason for the generated plans would be that the cost based optimizer determined the access paths were the 'best' given the data it has on hand (indexes available, statistics present, etc...).
    Perhaps your statistics are not representative of the data in the tables? What happens when you run the following in SQLPLUS
    set serveroutput off
    ALTER SESSION SET STATISTICS_LEVEL = ALL;
    select /*+ INDEX(t1 FIRST_TABLE_SPATIAL_INDEX) */ t1.rowid rid1,t2.rowid rid2, SDO_NN_DISTANCE(1) dist
    from dbti.FIRST_TABLE t1,dbti.FIRST_TABLE t2,dbti10.SECOND_TABLE w
    where w.r2='AAAkBmAAEAAAmbrAAE' and w.r1=t1.rowid and t1.cr01_idobjt2.cr01_idobj
    and t1.MY_FIELD IN ('plant','house')
    and t2.MY_FIELD IN ('plant','house')
    and t1.MY_FIELD = t2.MY_FIELD
    and sdo_nn(t2.GEOMFIELD,t1.GEOMFIELD,'sdo_num_res=5', 1)='TRUE' ;
    SELECT * FROM TABLE(DBMS_XPLAN.DISPLAY_CURSOR(NULL, NULL, 'ALL'));

  • I'm trying to Ignore a file header when reading a file, but no succes?? Take a look.... please...

    I posted the question in another forum,
    Take a look at my VI,
    What is wrong
    I'm trying to ignore the Header sekvens, (the first line) when reading the data to a chart.
    but ts noyt working,, did i missed something!?
    Zamzam
    HFZ
    Attachments:
    ReadDataFile11.vi ‏87 KB

    Hi again HFZ,
    The "read file" function has an option called "line mode" which is False by default, if you link a TRUE instead, you will only read one line of your file, you can then play with the offset in a while loop to read lines until the end of the file.
    But it might be even easier to read the whole file (with line mode False) then do a "spreadsheet string to array" (look in arra palette) and then remove the first line.
    I'm sorry I don't have time to have a look/modify your VI... On top of that you'll get much more satisfaction if you get through that yourself
    have fun !
    When my feet touch the ground each morning the devil thinks "bloody hell... He's up again!"

  • Oracle Text Index  - Trailing Search when the String has spaces

    Hi Am trying to use CONTAINS to tune a trailing LIKE search.  But it's not working when the string has spaces in between them
    For e.g in say if table person has column name which has following values
    JOHN
    FRED JOHNSON
    JOHN ROBERTS
    select * from person where name like 'JOHN%'
    Above query will give JOHN and JOHN ROBERTS. If i use CONTAINS As below
    select * from person where CONTAINS(name,'JOHN%',1) > 0
    It brings back all three records. If i remove spaces in column itself, its working bit if i try to remove spaces in Query, i am getting a Text error as i have Text index only on the name column.  I would like to know is it possible to use CONTAINS but get same result set on trailing search as how a normal LIKE will do.
    Below is how i did Index creation
    create index txt_idx1 on person (name)
    indextype is ctxsys.context
    parameters('DATASTORE ctxsys.default_datastore');

    You could use some method, like a multi_column_datastore or user_datastore to append some specific starting characters, then include those in your search, as shown below.
    SCOTT@orcl12c> CREATE TABLE person
      2    (name  VARCHAR2(60))
      3  /
    Table created.
    SCOTT@orcl12c> INSERT ALL
      2  INTO person VALUES ('JOHN')
      3  INTO person VALUES ('FRED JOHNSON')
      4  INTO person VALUES ('JOHN ROBERTS')
      5  SELECT * FROM DUAL
      6  /
    3 rows created.
    SCOTT@orcl12c> BEGIN
      2    CTX_DDL.CREATE_PREFERENCE ('test_ds', 'MULTI_COLUMN_DATASTORE');
      3    CTX_DDL.SET_ATTRIBUTE ('test_ds', 'COLUMNS', '''start ''||name||'' end'' name');
      4  END;
      5  /
    PL/SQL procedure successfully completed.
    SCOTT@orcl12c> create index txt_idx1 on person (name)
      2  indextype is ctxsys.context
      3  parameters('DATASTORE test_ds')
      4  /
    Index created.
    SCOTT@orcl12c> select * from person where CONTAINS(name,'start JOHN%',1) > 0
      2  /
    NAME
    JOHN
    JOHN ROBERTS
    2 rows selected.
    SCOTT@orcl12c>

  • I do not have many messages but my iphone 5s says messages take up 4.6GB of space.  When comparing with friends who have many more message, less than 1 GB is being used on their phones.  Why are mine taking up so much space and how do I correct that?

    I do not have that many messages on my new iPhone 5s (maybe about 15 conversations and only one or two going back a little ways) yet when I go to Settings, Usage it shows that my messages are taking up 4.6GB of space.  When comparing with others (some who have hundeds of messages) they are using under 1GB for their messages.  Why are mine taking up so much space??

    I found a post with this solution that worked for me - .Do a backup, then download ibackupbot. It lets you look into the contents of that backup. Look in system files>mediadomain>library>sms>attachments. I found a ton of huge files related to long deleted texts. ibackupbot let me delete all that old crap. I then restored the phone with that now modifec backup and Bingo! freed up 9 GB. No problems.
    But note, if you are not technically inclined you probaly don't want to be digging around and deleting back up files. You delete the wrong thing and you could jack up your phone badly. Be careful.

  • Trying to put pics on a flashdrive and keep getting error that there is not enough free space when there is.  I tried to empty trash with the flash drive in but still not working.  Help!

    Trying to copy photos in folder on desktop to a flash drive but keep getting error that there is not enough free space when there is.  I read to delete trash with the flash drive in but that still doesn't work.  Help!!

    How is the flash drive formatted? Open Disk Utility (Applications>Utilities) and see how it's formatted - that might be the problem.
    Clinton

  • Ignore time component when comparing dates

    DB version:10gR2
    In one of our codes , the client wants the dates to be compared by ignoring the time component from the date.
    ie they don't want MM:DD:YYYY HH:MI:SS, they just want MM:DD:YYYY,
    So I am modifying
      when ship_date > est_date_del
      to
      when to_char(ship_date, 'YYYYMMDD')> to_char(est_date_del,'YYYYMMDD')
      This is fine. Right? Will there be any issues relating to this comparision logic. You guys have any suggestions when comparing dates using to_char function?

    But if you use TRUNC without fmt , then date will be truncated to the nearest day. Right? Wouldn't that make the calculations wrong?
    Sorry?
    Here is one demonstration ->
    satyaki>
    satyaki>select * from v$version;
    BANNER
    Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Prod
    PL/SQL Release 10.2.0.1.0 - Production
    CORE    10.2.0.1.0      Production
    TNS for Linux: Version 10.2.0.1.0 - Production
    NLSRTL Version 10.2.0.1.0 - Production
    Elapsed: 00:00:00.00
    satyaki>
    satyaki>
    satyaki>with t
      2  as
      3    (
      4      select to_date('01-OCT-08 01:30:00','DD-MON-RR HH24:MI:SS') res from dual
      5    )
      6  select to_char(res,'DD-MON-RR HH24:MI:SS') orig_dt,
      7         to_char(trunc(res,'MONTH'),'DD-MON-RR HH24:MI:SS') cooked_dt
      8  from t;
    ORIG_DT            COOKED_DT
    01-OCT-08 01:30:00 01-OCT-08 00:00:00
    Elapsed: 00:00:00.00
    satyaki>
    satyaki>Regards.
    Satyaki De.

  • Stripping extra white space from a string

    I am trying to strip extra spaces from a string, so it there are 2 or more spaces between a word I want to remove all but one. I am trying the following code
    getStringTwo().replaceAll("/\s+/is","");
    but all I get is an error saying Invalid escape sequence
    Thanks
    G

    >
    This strips out all the whitespace. I ended up
    getting round it by walking through the string and
    checking the values of each char and comparing that
    to the next value. What a wast of effortt A small modification of my earlier post gives -
    public class Test040320a
        public static void main(String[] args)
            String str = "this    is       a \t test";
            str = str.replaceAll("\\s+"," ");
            System.out.println(str);
    }

  • Comparing String values against a collection of Names in a Hash Table

    Objective:
    Is to make a script that will import a csv file containing two values: "Name" and "Price". This would ideally be stored in a hash table with the key name of "Name" and the value being "Price". The second part would be
    importing a second csv file that has a list of names to compare too. If it finds a similar match to a key name in the hash table and then it will add that to a new array with the price. At the end it would add all the prices and give you a total value.
    The Problem to Solve:
    In the real world people have a tendency to not write names exactly the same way, for example I am looking at a list of books to buy in an eBay auction. In the auction they provide a text list of all the names of books for sale. In my price guide it has all
    the names and dollar values of each book. The wording of the way each book is named could differ from the person who writes it and what is actually in my reference pricing list. An example might be "The Black Sheep" vs "Black Sheep" or
    "Moby-Dick" vs "Moby Dick".
    I've tried making a script and comparing these values using the -like operator and have only had about 70% accuracy. Is there a way to increase that by 
    comparing the characters instead of likeness of words? I'm not really sure how to solve this issue as it's very hard to do quality check on the input when your talking about hundreds of names in the list. Is there a better way to compare values in power-shell
    then the "like" operator? Do I need to use a database instead of a hash table? In the real world I feel like a search engine would know the differences in these variations and still provide the desired results so why not for this type of application?
    In other words, create a bit more intelligence to say well it's not a 100% match but 90% so that is close enough, add it to the array as a match and add the price etc..
    I'd be curious as to any thoughts on this? Maybe a scripting language with better matching for text?

    Have you considered setting up a manual correction process that "learns" as you make corrections, automatically building a look up table of possible spellings of each Name?  If you get an exact match, use it.  If not, go to the look up
    table and see if there's been a previous entry with the same spelling and what it was corrected to.
    [string](0..33|%{[char][int](46+("686552495351636652556262185355647068516270555358646562655775 0645570").substring(($_*2),2))})-replace " "

  • Comparing Strings with "If" statements : help please. :-)

    I have an assignment for class... and having lots of trouble trying to figure out what I did wrong. I cannot find a solution.. if anyone can help me with this, it'd be much appreciated.
    Assignment Write a program to allow the user to calculate the area and perimeter of a square, or the area and circumference of a circle, or the area of a triangle.
    To do this, the user will enter one of the following characters: S, C, or T. The program should then ask the user for the appropriate information in order to make the calculation, and should display the results of the calculation. See the example program execution shown in class.
    The program should use dialog boxes.
    When expecting an S, C, or T, the program should reject other characters with an appropriate message.
    Get extra points for allowing both the uppercase and lowercase versions of a valid character to work. Name the program ShapesCalc.java.My error codes are
    incomparable types: java.lang.String and Char
    cannot find symbol variable output
    incomparable types: java.lang.String and Char
    incomparable types: java.lang.String and CharI've asked a friend and they said something about Strings cannot be compared in "If" statements... if that is the case.. how is this supposed to be arranged? If you can point me in the right direction, I will be very grateful! :-)
    What I have created so far
    import javax.swing.JOptionPane;
    public class ShapesCalc {
        public static void main(String[] args) {
          //Enter S,C, or T
          String input = JOptionPane.showInputDialog("Enter S,C, or T");
          //If Statements
          //Square
          if (input == 'S'){
               String lengthu = JOptionPane.showInputDialog("Enter length of a square");
               double length = Double.parseDouble(lengthu);
               double area = length * length;
               double perimeter = length * 4;
               String ouput = "The area is " + area + " and the perimeter is " + perimeter;
               JOptionPane.showMessageDialog(null, output);}
          //Circle
          else if (input == 'C'){
               String radiusu = JOptionPane.showInputDialog("Enter the radius of a circle");
               double radius = Double.parseDouble(radiusu);
               double area = 3.14159 * radius * radius;
               double circumference = 2 * 3.14159 * radius;
               String output = "The area is " + area + " and the circumference is " + circumference;
               JOptionPane.showMessageDialog(null, output);}
          //Triangle
          else if (input == 'T'){
               String baseu = JOptionPane.showInputDialog("Enter the base of a triangle");
               double base = Double.parseDouble(baseu);
               String heightu = JOptionPane.showInputDialog("Enter the height of a triangle");
               double height = Double.parseDouble(heightu);
               String output = "The area is " + (base * height) / 2;
               JOptionPane.showMessageDialog(null,output);}
          //Error Message
          else {
               String error = "Incorrect variable please enter S,C, or T only.";
               JOptionPane.showMessageDialog(null,error);}
          //Signature
          String signature = "Rodriguez, Markos has compiled a Java program.";
          JOptionPane.showMessageDialog(null,signature);
    }Edited by: ZambonieDrivor on Feb 22, 2009 6:52 PM

    ZambonieDrivor wrote:
    How would I go about on the extration of a single char from a String to make it comparable, I don't quite understand this part.Read the [Java API|http://java.sun.com/javase/6/docs/api/] for the String class and see what methods it has.
    I will convert the == to equals() method.If you want to compare primitives (ints, chars etc) then using == is fine. Only when comparing objects do you use the equals method.

  • Compare string in different line in text file

    I am new to java and I need a simple example to compare string in file text by for loop
    file.txt:
    A78802 D06VAIS060253113 WKNEUP751346577450
    A77802 D06VAIS060253113 WKNEUP751346577450
    A76802 D06VAIS060253925 WKNEUP751346577450
    A78802 D06VAIS075253698 WKNEGE226375082796
    A73802 D06VAIS116253222 WKNEFB227345305299
    dataString = TextIO.getln();
    A=dataString.substring(25,42);
    B=dataString.substring(195,203);
    C=dataString.substring(171,186);
    I WANT COPMPARE IN LINE 1 POSITION 20 TO LINE 2 POSITION 20 BY LOOPS ALL THE LINE IN TEXT FILE

    what have you tried so far?
    Also, when posting your code, please use code tags so that your code will retain its formatting and be readable. To do this, either use the "code" button at the top of the forum Message editor or place the tag &#91;code] at the top of your block of code and the tag &#91;/code] at the bottom, like so:
    &#91;code]
      // your code block goes here.
    &#91;/code]

  • C:choose for comparing strings

    Hi,
    I am trying to apply alternate styles to table rows using JSTL. When I am comparing strings it always falls into the 'otherwise' block. I guess I either have a silly error or there is something I am missing. When I output the string with the c:out it is set to the value 'data_row_white', which is what I find confusing as the test should prove true.
    I have also tried using the 'eq' operator to compare.
    Any help is appreciated.
    <c:set var="col_css" scope="page" value="data_row_white" />
            <c:forEach items="${requestScope['local_catalogue_list']}" var="item">
                <tr class="${col_css}">
                    <td class="no_top_no_right"><a href="javascript:viewCatalogue('${item.catalogueID}');">${item.catalogueName}</a></td>
                    <td class="no_top_middle">${item.status}</td>
                    <td class="no_top_no_left">${item.versionID}</td>
                </tr>
                <c:out value="${col_css}" />
                <c:choose>               
                    <c:when test="${col_css == 'data_row_white'} ">
                        <c:set var="col_css" scope="page" value="data_row_gray" />
                    </c:when>
                    <c:otherwise>                   
                        <c:set var="col_css" scope="page" value="data_row_white" />
                    </c:otherwise>
                </c:choose>
            </c:forEach>

    Using the ternary operator in EL which intercepts on the loop index is a much better/clearer/quickier way to alternate table rows.
    Basic example:    <table>
            <c:forEach items="${users}" var="user" varStatus="loop">
                <tr class="${loop.index % 2 == 0 ? 'even' : 'odd'}">
                    <td>${user.id}</td>
                    <td>${user.username}</td>
                    <td>${user.email}</td>
                    <td>${user.age}</td>
                </tr>
            </c:forEach>
        </table>

  • I am trying to get space on an external hard drive which has some old time machine back up files that I do not need but can not eliminate, even by going into the time machine, clicking on the backup file to be eliminated and using the drop down eliminate

    I am trying to get space on an external hard drive which has some old time machine back up files that I do not need but can not eliminate, even by going into the time machine, clicking on the backup file to be eliminated and using the drop down menu with the gear box symbol to eliminate

    I cannot find this 300GB "Backup" in the Finder, only in the Storage info when I check "About This Mac".
    You are probably using Time Machine to backup your MacBook Pro, right? Then the additional 300 GB could be local Time Machine snapshots.  Time Machine will write the hourly backups to the free space on your hard disk, if the backup drive is temporarily not connected. You do not see these local backups in the Finder, and MacOS will delete them, when you make a regular backup to Time Machine, or when you need the space for other data.
    See Pondini's page for more explanation:   What are Local Snapshots?   http://pondini.org/TM/FAQ.html
    I have restarted my computer, but the information remains the same. How do I reclaim the use of the 300GB? Why is it showing up as "Backups" when it used to indicate "Photos"? Are my photos safe on the external drive?
    You have tested the library on the external drive, and so your photos are save there.  
    The local TimeMachine snapshot probably now contains a backup of the moved library.  Try, if connecting your Time Machine drive will reduce the size of your local Time Machine snapshots.

Maybe you are looking for

  • Vat declaration - configuration in erp system

    Hello experts, I configured elster vat declaration in PI system as described in sap note 1293294. But what I have to configure at erp system? sap note 1293294 only describes that I have to select the Exchange Infrastructure transfer type in transacti

  • Multi-context active-active etherchannel failover

    Hi All, Is there a way to monitor individual interfaces on a box doing multicontext etherchannel failover? I can understand on an individual box you can add monitor-interface to the physical interface, but in multi context mode, there is only one int

  • HT5163 I have a replacement 3G and I cannot find a SIM card there is no opening anywhere on the iPhone

    Is there a SIM card in a 3G iPhone ?  I'm trying to do the replacement and can't find it anywhere on the phone.  I've backed up my old phone and need to do the reset, but where's the SIM card. ModelA1349

  • Dreamweaver CS4 FTP Access Denied error

    We recently purchased and installed Adobe CS 4 Design Suite. I am trying to install and configure  Dreamweaver CS4 to maintain our website. I had a trial version on a PC which works fine. I have a Mac OS X 10.5.8 and I installed the newly purchased D

  • Update Marketing attributes in Interactive Scripting

    Hi All, I would like to know if anyone knows how to : 1. Display multi value fields in Interactive Scripting 5.2     In standard IS editor, there is a dynamic answer "Marketing Attribute 5.1". We need to create new ones. What it the process ? 2. Upda