Date stuff

So here's the deal. I have a program that takes in two dates as a strings. The program then increments the first date, one day at a time, until it reaches the second date.
I'm currently doing pretty much all the date checking "by hand," storing the day, month year as strings and checking them against eachother as needed. This is starting to cause a huge headache, and I figure other people have parsed, incremented, and checked the validity of dates before, so, how do you do that the right way??
I looked at using SimpleDateFormat to parse the string into a Date, but that brings me to a few problems. It doesn't seem to check for invalid data:
----------code--------
SimpleDateFormat sdf = new SimpleDateFormat ("MMddyy");
System.out.println( sdf.parse(stripDelimiters(args[0])) );
------------run-------
C:\working>java Driver 11/313/3303
Sat Dec 01 00:00:00 EST 33303
I need this to throw an exception or something if it's a bad date, not assimilate it. Also, assuming I was okay with the date as a Date object, how do I then increment it.
I've been wrestling w/ this for a while, and any suggestions would help, thanks.

hi,
There is a method in Calendar class add(calendar.DATE,int amount)
the amount is no.of days u want to add to date.
I hope this will help.
Regards
Sekhar

Similar Messages

  • Can some one help me with this date stuff

    Hello,
    I wat to write a method that will take a date or a month and then return the time period
    b4 that date or month..criteria would be like this..
    if the pweriod is weekly then the enddate will be passed and it should return date that was 7 days
    prior to the enddate. For e.g
    enddate = 3 April 2002
    the method should return
    begindate = 27 March 2002
    here is the method I am trying to work with...
    what I am doing do far is a break down the date into integer values and then reconstruct the date again
    ...I am not being successful doing so..please take a look at my code and tell me what am I doing wrong
    thanks
    public static Date getBiginingOfPeriodDate(Date endDate){
    Date beginDate = null;
    Calendar calendar = Calendar.getInstance();
    System.out.println("Date passed = "+endDate);
    calendar.setTime(endDate);
    int iDay = calendar.get(Calendar.DAY_OF_MONTH);
    int iMon = calendar.get(Calendar.MONTH);
    int iYr = calendar.get(Calendar.YEAR);
    System.out.println("End date int values [ "+iDay+", "+iMon+", "+iYr);
    calendar.set(iDay,iMon,iYr);
    System.out.println("create end date from in values [ "+calendar.getTime()+" ]");
    return beginDate;
    }

    If all you want to do is simple date arithmetic, such as subtracting 7 days from a date, just use the java.util.Calendar class, which provides methods (such as add) to do that for you. Don't "reinvent the wheel".

  • Problem with select query that includes a date

    I've been fighting with this for about 4 hours - yes, quite literally... I've never been good with date stuff. I have a brain block.
    Anyway, here's the situation:
    I have an Access database that has a time/date field. There are no times, just a date in mm/dd/yyyy format.
    That table is a list of classes held for the past three years. I want to make a query that only shows the classes that have ended after January 1 of this year. I don't want to put 01/01/2010 in the query itself because I want it to still work next year.
    This is the current query:
    <cfquery name="classes" datasource="#DSN#" dbtype="ODBC">
    SELECT classesTitles.ClassTitle, classesTitles.ClassDesc, classCatagories.catagoryName, classes.classStart, classes.classEnd, classes.classNotes, owners.fName, owners.lName, classTime.timeSlot, classes.classID, classes.classLimit
    FROM classCatagories INNER JOIN (((classes INNER JOIN classesTitles ON classes.classTitle = classesTitles.classTitleID) INNER JOIN classTime ON classes.classTime = classTime.timeID) INNER JOIN owners ON classes.classInstructor = owners.ownerID) ON classCatagories.catagoryID = classesTitles.ClassType
    WHERE  classes.classEnd <  01/01/#DatePart("yyyy", now())#
    ORDER BY classes.classStart, classCatagories.catagoryName, classTime.timeSlot, classesTitles.ClassTitle
    </cfquery>
    I don't get any results, but I should get a list of every class that has an end date before January 1 of this year - about 200 records.
    When I swap around the where clause to:
    <cfquery name="classes" datasource="#DSN#" dbtype="ODBC">
    SELECT classesTitles.ClassTitle, classesTitles.ClassDesc, classCatagories.catagoryName, classes.classStart, classes.classEnd, classes.classNotes, owners.fName, owners.lName, classTime.timeSlot, classes.classID, classes.classLimit
    FROM classCatagories INNER JOIN (((classes INNER JOIN classesTitles ON classes.classTitle = classesTitles.classTitleID) INNER JOIN classTime ON classes.classTime = classTime.timeID) INNER JOIN owners ON classes.classInstructor = owners.ownerID) ON classCatagories.catagoryID = classesTitles.ClassType
    WHERE  classes.classEnd > 01/01/#DatePart("yyyy", now())#
    ORDER BY classes.classStart, classCatagories.catagoryName, classTime.timeSlot, classesTitles.ClassTitle
    </cfquery>
    I get EVERY class in the database, and I should only be getting about 50
    The classes are about 8 weeks long, the begin date and end date are in the database as date/time fields, so I need to show everything that ended in 2010, regardless of when it started.
    I'm sure it's something glaringly obvious, but it's escaping me.
    THANKS
    Michelle

    The format of your date field in access is irrelevent to the situation at hand.  Use proper date objects instead of trying to build a suitable string.  For the first of January of the current year, the coldfusion functions createdate(), year(), and now() are your freinds.  Then, in case Adam's post was not clear, use cfqueryparam with the resulting variable.

  • Send email including the data field into the html message body

    Hi all,
    I would like to send an email to each recipient once only, and including a data field into the html body message. I am not sure how to achive that with my current stored procedure.
    USE [CallManager]
    GO
    /****** Object: StoredProcedure [dbo].[PersonalCallsReminder] Script Date: 08/27/2014 10:26:55 ******/
    SET ANSI_NULLS ON
    GO
    SET QUOTED_IDENTIFIER ON
    GO
    -- =============================================
    -- Author: <Author,,Name>
    -- Create date: <Create Date,,>
    -- Description: <Description,,>
    -- =============================================
    ALTER PROCEDURE [dbo].[PersonalCallsReminder]
    AS
    BEGIN
    -- SET NOCOUNT ON added to prevent extra result sets from
    -- interfering with SELECT statements.
    SET NOCOUNT ON;
    -- Email Users
    declare @email varchar(max)
    declare mycursor cursor FAST_FORWARD for
    SELECT dbo.HumersStaffExtension.email
    FROM dbo.Calls_Mobile_Header INNER JOIN
    dbo.HumersStaffExtension ON
    dbo.Calls_Mobile_Header.TelNumber = dbo.HumersStaffExtension.telnr_prv COLLATE SQL_Latin1_General_CP1_CI_AS
    GROUP BY dbo.Calls_Mobile_Header.RecordStatus, dbo.HumersStaffExtension.usr_id, dbo.HumersStaffExtension.email,
    dbo.HumersStaffExtension.res_id
    HAVING (dbo.Calls_Mobile_Header.RecordStatus = N'0') AND (NOT (dbo.HumersStaffExtension.email IS NULL))
    OPEN mycursor;
    FETCH NEXT FROM mycursor
    INTO @email
    WHILE @@FETCH_STATUS = 0
    BEGIN
    EXEC msdb.dbo.sp_send_dbmail
    @profile_name = 'CallsManagement',
    @recipients = @email ,
    @body_format = 'HTML',
    @subject = 'Personal Calls Reminder',
    @body = '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
    <title>Personal Calls Reminder</title>
    <style type="text/css">
    body {
    font-family: "Times New Roman", Times, serif;
    font-size: 11pt;
    .auto-style1 {
    background-color: #FFFF00;
    </style>
    </head>
    <body>
    <div>
    <table style="width: 800px">
    <tr>
    <td>Dear,<br />
    <br />
    Please review your phone bills and submit your personal calls using the following link:<br />
    <a href="http://companyxyz/personalcalls/">Personal Calls</a></td>
    </tr>
    </table>
    <br/>
    <table style="width: 800px">
    <tr>
    <td><strong>Kindly be informed that the deadline to process new bills is on the
    <span class="auto-style1">15th of each month</span>.</strong></td>
    </tr>
    </table>
    <br/>
    <table style="width: 800px">
    <tr>
    <td>For assistance, please contact <a href="mailto:[email protected]">[email protected]</a></td>
    </tr>
    </table>
    <br/>
    <table style="width: 800px">
    <tr>
    <td><strong>*** This is an automatically generated email, please do not reply ***</strong></td>
    </tr>
    </table>
    </div>
    </body>
    </html>
    FETCH NEXT FROM mycursor
    INTO @email
    END
    CLOSE mycursor;
    DEALLOCATE mycursor;
    END
    Changing the query to the following:
    SELECT TOP (100) PERCENT dbo.HumersStaffExtension.email, dbo.Calls_Mobile_Header.ExtractDate
    FROM dbo.Calls_Mobile_Header INNER JOIN
    dbo.HumersStaffExtension ON
    dbo.Calls_Mobile_Header.TelNumber = dbo.HumersStaffExtension.telnr_prv COLLATE SQL_Latin1_General_CP1_CI_AS
    GROUP BY dbo.Calls_Mobile_Header.RecordStatus, dbo.HumersStaffExtension.usr_id, dbo.HumersStaffExtension.email, dbo.HumersStaffExtension.res_id,
    dbo.Calls_Mobile_Header.ExtractDate
    HAVING (dbo.Calls_Mobile_Header.RecordStatus = N'0') AND (NOT (dbo.HumersStaffExtension.email IS NULL))
    ORDER BY dbo.HumersStaffExtension.email
    Will provide me with the following results:
    email ExtractDate
    [email protected]
    July-2014
    [email protected]
    August-2014
    [email protected]
    July-2014
    [email protected]
    August-2014
    Is it possible to send email to [email protected] once only including in the html message body the ExtractDate field results for July-2014 and August-2014? 
    I appreciate any assist on the issue.
    Thank you in advance.

    Refer the below code highlighted in bold.
    USE [CallManager]
    GO
    /****** Object:  StoredProcedure [dbo].[PersonalCallsReminder]    Script Date: 08/27/2014 10:26:55 ******/
    SET ANSI_NULLS ON
    GO
    SET QUOTED_IDENTIFIER ON
    GO
    -- =============================================
    -- Author:  <Author,,Name>
    -- Create date: <Create Date,,>
    -- Description: <Description,,>
    -- =============================================
    ALTER PROCEDURE [dbo].[PersonalCallsReminder]
    AS
    BEGIN
     -- SET NOCOUNT ON added to prevent extra result sets from
     -- interfering with SELECT statements.
     SET NOCOUNT ON;
     -- Email Users
    declare @email varchar(max),@date datetime
    declare @temp table (email varchar(50), extractDate datetime)
    insert into @temp
      SELECT     TOP (100) PERCENT dbo.HumersStaffExtension.email, dbo.Calls_Mobile_Header.ExtractDate
      FROM         dbo.Calls_Mobile_Header INNER JOIN
             dbo.HumersStaffExtension ON
             dbo.Calls_Mobile_Header.TelNumber = dbo.HumersStaffExtension.telnr_prv COLLATE SQL_Latin1_General_CP1_CI_AS
      GROUP BY dbo.Calls_Mobile_Header.RecordStatus, dbo.HumersStaffExtension.usr_id, dbo.HumersStaffExtension.email, dbo.HumersStaffExtension.res_id,
             dbo.Calls_Mobile_Header.ExtractDate
      HAVING      (dbo.Calls_Mobile_Header.RecordStatus = N'0') AND (NOT (dbo.HumersStaffExtension.email IS NULL))
      ORDER BY dbo.HumersStaffExtension.email
    declare mycursor cursor FAST_FORWARD for SELECT DISTINCT email from @temp
    OPEN mycursor;
    FETCH NEXT FROM mycursor
    INTO @email
    WHILE @@FETCH_STATUS = 0
    BEGIN
        DECLARE @date nvarchar(200)
        SELECT @date=Stuff((SELECT ',' + [extractDate]
                  FROM   @temp  where email = @email
                  FOR xml path('')), 1, 1, '')
           EXEC msdb.dbo.sp_send_dbmail
                @profile_name = 'CallsManagement',
                @recipients = @email ,
                @body_format = 'HTML',
                @subject = 'Personal Calls Reminder',
                @body = '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
    <title>Personal Calls Reminder</title>
    <style type="text/css">
     body {
     font-family: "Times New Roman", Times, serif;
     font-size: 11pt;
    .auto-style1 {
     background-color: #FFFF00;
    </style>
    </head>
    <body>
    <div>Extract Date : ' + @date + '</div>
    <div>
     <table style="width: 800px">
      <tr>
       <td>Dear,<br />
       <br />
       Please review your phone bills and submit your personal calls using the following link:<br />
       <a href="Personal">http://companyxyz/personalcalls/">Personal Calls</a></td>
      </tr>
     </table> 
     <br/>
     <table style="width: 800px">
      <tr>
       <td><strong>Kindly be informed that the deadline to process new bills is on the
       <span class="auto-style1">15th of each month</span>.</strong></td>
      </tr>
     </table>
     <br/>
     <table style="width: 800px">
      <tr>
       <td>For assistance, please contact <a href="[email protected]:[email protected]">[email protected]</a></td>
      </tr>
     </table>
     <br/>
     <table style="width: 800px">
     <tr>
     <td><strong>*** This is an automatically generated email, please do not reply ***</strong></td>
     </tr>
     </table>
    </div>
    </body>
    </html>
          FETCH NEXT FROM mycursor
          INTO @email
    END
    CLOSE mycursor;
    DEALLOCATE mycursor;
    END
    Regards, RSingh

  • About to leave to Cancun Mexico (yay!) - questions about data/wi-fi

    Hey all!
    I'm about to go on my first international trip with my beloved iPhone. I know the hotel has free Wi-Fi down there, and I'd love to be able to use the phone for email checking and other data stuff - but I don't want any surprises with international data fees up the wazoo or anything.
    If I don't plan on sending text messages or make calls but just use the wi-fi features while down there - what should I do? Any setting I need to be careful with etc?
    Any advice highly appreciated!
    // martin

    You should be Ok to go down there as is. A couple things you can do.
    Are you just going to use the iPhone for WiFi and nothing else?
    If so you have the possibility of removing the SIM card to ensure it hits no Cell Towers and transmits data. But of course it means the SIM card should be stored in a safe spot and not lost.
    But we also have a feature that turns Data roaming OFF to help assist with Data Roaming charges.
    When abroad, turning off Data Roaming may avoid roaming charges when using email, web browsing, and other data services.
    By default it is off. But to check. Go to Settings- General- Network and on the bottom is Data Roaming which should be off.
    You can also consult AT&T and see if they got a cheap international data coverage plan you can be put on for the time you will be in Mexico.
    I am sure our posters here can advise other ideas as well. Have a great vacation

  • Logging RS232 and analog data

    Hi guys,
    I'm trying to log data from my RS232 instrument, and also include a couple of analog inputs. 
    The vi works "ok", but not great.  First off, the frequency on the daq assistant needs to be set very high to see a resonable refresh rate on the screen.   Secondly, the time sync is off on the data being logged from rs232 (unbundle node) and the analog inputs.
    I like using the daq assistant and the write to file vi only because they are simple to set up.  Not too familiar with any other methods.
    Any thought on how to make these 2 issues (plus a few more) better?
    Formatting the front panel is still being tweaked. see attached.
    This is a modified instrument driver vi, and the instrument driver vi library.  Hope this works for you guys.  Thanks for the help.
    thanks
    Darren 
    Solved!
    Go to Solution.
    Attachments:
    als8v0.llb ‏363 KB
    AlicatReadLooped8V0 trial.vi ‏240 KB

    I've turned the baud rate up to 38600 thinking that may help my problem.  I'm not really clear what that instrument driver vi is sending to the instrument  - I'm simply opening a visa, and getting data streaming from the instrument.....? At least that's what I assumed.
    So I disabled all the other data stuff, including the "set pont" vi which basically just changes the valve opening amount, and I still don't get anything greater than approximately 2-3 points per second.  I was attempting to eliminate everything else from the code to diagnose the source of the slow data rate.  This told me it's definitely the instrument driving the data rate.
    However, when I open up hyperterminal, data streams by very fast.   Seems way faster than 2-3 data points per second.
    I attempted to turn the device ID from A to @, thinking this should turn the data to streaming from polling, but the communication didn't work (referring to  my vi didn't display data any longer).  .
    I'd like to get about 10 per second.  I'm measuring pressure and mass flow, so that's about all I should be logging for a physical parameter
    Thanks for the help.  I need it.  haha
    Darren.
    Ravens Fan wrote:
    If you had absolutley nothing else going on, no DAQ assistant, no logging to file, just reading data from your RS-232 port, how quickly could your loop run?  Dealing with serial ports, it generally takes time to send the command, wait for the instrument to act on it, and then wait for the response to come back.  Three times per second doesn't sound that bad.  What is your baud rate?  If the messages are short, and the baud rate is high enough, I don't think you can really expect more than about 10 readings per second from a serial device.

  • Slider and date

    I have a slider like so:
    <mx:HSlider id="myslider" width="245"
    allowThumbOverlap="true" thumbCount="1" snapInterval="1"
    tickInterval="1"
    values="[11]" labels="['Jan', 'Dec']" minimum="1"
    maximum="12" change="sliderChangeTwo(event)"
    dataTipFormatFunction="getSliderLabel" themeColor="#73B9B9"/>
    every month I go in and change the values to the current
    month like November is 11. How can I have it shoe this month
    automatically. I have been looking at the date stuff but there is
    an error because dates are strings and the slider acceps numbers.
    Any thoughts?
    Thanks
    George

    ..and here's another way to do it...
    View source at:
    http://www.anaheimwib.com/_comps/slider/
    Main difference is I'm using arithmetic on the current date
    to get you a date one month out, and using the formatted result as
    a bindable in the slider labels property. Since the "futureDate"
    var contains today's date + one month, you could also use this var
    anywhere else in your code where you need the entire future date.
    This is useful at the end of the current year, where you might want
    to add two months to today's date, and get a date in 2009, for
    instance.
    I included the use of the Date formatter class to get you
    started on returning just a portion of a date, formatted as you
    wish (M="1", MM="01", MMM= "Jan", MMMM= "January"). Simply change
    the formatter's format string and the slider's labels will also be
    updated.
    On more thing...if you are planning on using the slider's
    retun value to get a month's number, remember that in actionscript
    the month numbering starts at 0 (you are specifying 1-12; AS uses
    0-11).
    Complete code:

  • Date/Calendar Questions

    How do I go about setting the following code to be called in a single command like like SetMyDate(5, 10, 30) instead of the long code which appears in the main()
    currentTaskDate = new String(days[currentDate.getCalendar.DAY_OF_WEEK)]+ ", " + months[currentDate.get(Calendar.MONTH)] + " " + currentDate.get(Calendar.DATE) + ", " + currentDate.get(Calendar.YEAR));
    CODE BELOW
    // Created: 8/7/03
    // Author: Dustin McBeth
    // Estimated Time: 2 H
    // Purpose: I'm trying to set a a globel date
    // Steps
    // - Make thingy and output date on system out commend
    import java.util.*;                    // for table and stuff
    import java.util.Date;               // for the calender
    import java.util.Calendar;
    public class MyDate {
         // Date Stuff
         static Date today = new Date();     
         static Calendar currentDate = new GregorianCalendar();
         // Setting text for date numbers
         public static String days[] = {"","Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saterday"};
         public static String months[] = {"January","February","March","April","May", "June","July","August","September","October","November", "December"};
         static String currentTaskDate = new String(days[currentDate.get(Calendar.DAY_OF_WEEK)]
                                       + ", " + months[currentDate.get(Calendar.MONTH)]
                                       + " " + currentDate.get(Calendar.DATE)
                                       + ", " + currentDate.get(Calendar.YEAR));
         public static void main(String[] args) {
         currentDate.setTime(today);
         System.out.println(currentTaskDate);
         today = new Date(5, 10, 30);
         currentDate.setTime(today);
         currentTaskDate = new String(days[currentDate.get(Calendar.DAY_OF_WEEK)]
                                       + ", " + months[currentDate.get(Calendar.MONTH)]
                                       + " " + currentDate.get(Calendar.DATE)
                                       + ", " + currentDate.get(Calendar.YEAR));
         System.out.println(currentTaskDate);
    }

    Never Mind, I got it figured out:
    // Created: 8/7/03
    // Author: Dustin McBeth
    // Estimated Time: 2 H
    // Actual Time: 4 H
    // Purpose: I'm trying to set a a globel date
    // Steps
    // X Make thingy and output date on system out commend (Done 8/7/03)
    import java.util.*;                    // for table and stuff
    import java.util.Date;               // for the calender
    import java.util.Calendar;
    public class MyDate2 {
         // Date Stuff
         static Date today = new Date();     
         static Calendar currentDate = new GregorianCalendar();
         // Setting text for date numbers
         public static String days[] = {"","Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saterday"};
         public static String months[] = {"January","February","March","April","May", "June","July","August","September","October","November", "December"};
         static String currentTaskDate;
         static void setMyDate() {
    //     today.set(Year, Month, Day);
         currentTaskDate = new String(days[currentDate.get(Calendar.DAY_OF_WEEK)]
                                       + ", " + months[currentDate.get(Calendar.MONTH)]
                                       + " " + currentDate.get(Calendar.DATE)
                                       + ", " + currentDate.get(Calendar.YEAR));
    //     return this;
         public static void main(String[] args) {
         currentDate.setTime(today);
         setMyDate();
         System.out.println(currentTaskDate);
         today = new Date(5, 10, 29);
         currentDate.setTime(today);
         setMyDate();
         System.out.println(currentTaskDate);
    }

  • Can only sync photos by dropping folder on desktop - iPad won't sync photos

    Hi all,
    I've been trying for a couple weeks now to sync photos to my iPad.
    I'm running SL 10.6.2 and have updated to the latest iTunes. I have one hard drive that runs only my OS and my applications and I have a secondary drive that contains all my data including music, videos, photos, documents etc.
    I have been able to repeatedly successfully sync apps, movies, music, and even a pages document to my iPad from the secondary drive through iTunes.
    Every single time I have tried to sync photos it just seems to hang at the Sync in Progress screen for hours. I finally have to cancel because it's obvious the sync will not be successful. This happens whether I have one folder selected with just a dozen photos or several folders selected.
    I am not using iPhoto. I'm simply choosing the folders with the images I'd like to sync from the Photos tab in iTunes when my iPad is connected.
    Today I took one of the folders I was trying to sync containing 12 photos and dropped it on my desktop. The photos synced in seconds and iPad happily said sync complete. Any ideas?
    Is this a quirk with SL 10.6.2, iTunes 9.1, or iPad?
    It's not necessarily a huge issue that I have to move all the photos I want to sync to my main mac drive... but I just really didn't want to clutter my OS drive with data stuff... I prefer to keep them separate. Seems the only way I can sync photos right now, though, is to move them to the main mac drive... even though everything else syncs just fine from the secondary drive...
    Thanks for any help!
    ~ Angela

    It looks like noone has and Idea how to fix this problem ;-(

  • Using Excel VBA to save PDF file as a text (plain) file?

    I'm using 8.0 Acrobat Pro.
    Third party apps are not an option (I'm restricted from installing anything on my office PC).
    I could simply save each PDF manually, but given the number of files this would not be practical.
    The text it will output does not have to be pretty by any means (and I'm aware it won't be).
    As long as I can get the PDF files in a text file format, there would be no further obstacles for me - because I would then be able to get Excel to gather-import all the data and consolidate-clean-organize everything accordingly at that point.
    What's in these PDF files are simply names, numbers, and email addresses (basic office text type data stuff simple).
    I wish to save them all as text files, and then use Excel to suck all the data from those newly created text files and consolidate-organize them accordingly.
    The VBA module I've seen referrenced around the web is the following beneath; however, I am having no luck with it.
    I keep getting the error message:
    ActiveX component can't create object or  return reference to this object (Error 429)
    I am running Microsoft Office 2010 | Excel (and using Adobe Acrobat Pro 8.0).
    Any help is extremely appreciated.
    Here is the VB code in Excel I'm having trouble with:  What this is supposed to do is simply find the specified PDF file and save it as a Plain Txt File.
    Sub Convert_PDF_To_Text_File()
    Dim AcroXApp As Object
    Dim AcroXAVDoc As Object
    Dim AcroXPDDoc As Object
    Set AcroXApp = CreateObject("AcroExch.App")
    AcroXApp.Hide
    Set AcroXAVDoc = CreateObject("AcroExch.AVDoc")
    AcroXAVDoc.Open strPDFPath, "Acrobat"
    AcroXAVDoc.BringToFront
    Set AcroXPDDoc = AcroXAVDoc.GetPDDoc
    Dim jsObj As Object
    Set jsObj = AcroXPDDoc.GetJSObject
    jsObj.SaveAs strOutputFile, "com.adobe.acrobat.plain-text"
    AcroXAVDoc.Close False
    AcroXApp.Exit
    End Sub

    one other thought is that you can create text files with a batch process inside of acrobat.  Advanced ---> Document Processing ----> Batch Processing.
    Choose new sequence, give it a name
    Step 1: Select Commands ----> Choose "execute javascript", then hit "Add."  Click on "Execute Javascript" that was just added on the right, then hit the edit button and toss in the script below that I grabbed from the javascript samples (also, if your docs have multiple pages you'll need to embed the for loop into another for loop that cycles through each page).  You'd also want to change the name of the saved txt file to the name of pdf you're doing it to.  It shouldn't be that hard, but I'm guessing you're probably alot more familiar with VBA then javascript which is why you're choosing to do it from excel.  I'm kind of in the same boat of having written a bunch of VBA, but not much javascript.  I highly recommend investing some time into learning acrobat scripting b/c VB does have it's limitations when it comes to messing with PDF's.
    * function to extract the text content of the current page and save to a file.
    try  {
    var p = this.pageNum;
    var n = this.getPageNumWords(p);
    app.alert("Number of words in the page: " + n);
    var str = "";
    for(var i=0;i<n;i++) {
    var wd = this.getPageNthWord(p, i, false);  
    if(wd != "") str = str + wd;  
    // save the string into a data object
    this.createDataObject("whatever.txt",str); 
    // pop up a file selection box to export the data
    this.exportDataObject("whatever.txt");
    // clean up
    this.removeDataObject("whatever.txt");
    } catch (e)  { 
    app.alert(e)

  • Smart Form  for cutomised Inovice, Functional spec

    Dear all,
    I need to give Functional specification for developing a smart form for Invoice. Tables are not as evident as we have in case of R/3. please give me general tips to give spec to abap consultant to fetch various fields.
    where used list of tables for a particular field is also not helping much. I need
    1) Bill to address
    2) sold to address
    3)condition data
    4) terms of payment
    5) reference date stuff
    Please suggest me a general way or logic bassed on which i can ask my abap consultant to develop the smartform and driver prog as well.
    Thnaks in advance,
    Regards,
    Kiran C

    Hi
    yes usually customers ask to adopt the same layout as they are already using. Usually I draw the layout on visio and assign a number for each field. In the spec I put the layout picture and and mention for which field where data will come from.
    For example:
    A. PO header:
    Field number | Description | Source
    1 | PO number | EKKO-EBELN
    2 | Vendor code | EKKO-LIFNR
    3 | Vendor name | LFA1-NAME1 * rule 1
    C. Rules:
    1 - select NAME1 from table LFA1 where LFA1-LIFNR = EKKO-LIFNR
    Hope this helps.
    Regards
    Eduardo Chagas

  • I recently bought the newest macbook pro with only 120 GB of disk space I need to upgrade and was wondering if this would work with my computer 500GB New Sata 2.5" hard drive?

    I bought the newest macbook pro 13" with only 120 GB of space. I quickly used all of the space up and need a lot more. I was wondering if this disk is compatible with the model i have.
    500GB New Sata 2.5" hard drive

    Your best practical option is buying a 1TB external HD for $65
    The "low" capacity of the SSD on the Air and entry level Retina are meant to be working platforms for these computers.
    Meaning ALL your programs and your working data (stuff you use at least every week).
    To try to use either the Air or  Retina as a storage platform of any king (lots of pics, music, movies etc.) is both not indicated or practical.
    external storage, quality too, is absurdly cheap right now.
    You asked:
    These are very expensive theres no way that an hdd drive would be compatible with my Mac?
    yes, a superslim external HD.
    see this: only 7mm thick
    http://www.amazon.com/Toshiba-Canvio-Portable-External-Drive/dp/B009F1CXI2/ref=s r_1_1?s=electronics&ie=UTF8&qid=1377642728&sr=1-1&keywords=toshiba+slim+500gb
    Or better still this HUGE HD, which is very small, very reliable and very cheap:
    2 Terabytes, 2.5" and only $119
    http://www.amazon.com/Toshiba-Canvio-Basics-Portable-HDTB120XK3CA/dp/B00ARJD56K

  • IMac 1TB Seagate Hard Drive Replacement Program - how long does it take?

    I started a new thread for this issue since the original thread has degenerated into a rant. I just got my love letter from Apple informing me that my new 27" iMac has the bad drive. I backup to an external USB drive using Time Machine, and I am planning to have my nearest Apple store replace the drive sometime in the next few weeks.
    I am posting to ask if anyone has yet contacted Apple about this issue? I am curious how long it takes to swap the drives. Can it be done while you wait? Does Apple have any ability to clone the old drive's data to the new? Has anyone been able to arrange for in-home service as mentioned in the original thread?
    Please don't use this new thread to rant about the problem. If you need to let off steam, please post to the original thread.
    Thanks for the help!

    Greetings from an apple mac newbie in UK. On the one hand, after getting the email today I was disappointed to find my brand new shiny mac 21.5 might have a fault on hard drive, on the other at least apple points it out! But doubly frustrating for someone that has just taken the plunge and converted from pc/microsoft rubbish after two decades and still finding my feet in macworld....and who upgraded to OS X lion this past weekend without a hitch (nervous as an XP SP2/SP3 veteran)...and had to pay for Lion because I bought my imac just a week to early to qualify for free Lion upgrade.
    My decision on Hard drive is to wait and see, firstly to guage experience of apple turn around times/customer experience etc in UK and secondly because I would like to understand what kind of percentage of the seagate drives are faulty...I am backing up with time machine, the machine is under warranty and applecare too, so maybe no need to rush, there's a year yet at least.
    Another consideration for me is that I bought my mac with dual drives -  the 1TB Harddrive for data and the 256SSD for OSX/apps...idea was to keep the programs on the ssd as it is fastest and is best with less rewrites, the conventional hard drive then used for big data stuff like docs, music and photos. This needed a bit of custom set up involving apple support to get the right things on the right drives, so am in no hurry to muck that up!
    PS does anyone else in the UK have my mac dual drive  configuration...?

  • How to Install Elements 5 Without Installing the Flash Player that is On the Photoshop Elements 5 CD

    Having just changed the operating system here from Microsoft Windows XP Pro to Microsoft Windows 7 Pro (64 bit), it is desirable to install the Existing Photoshop Elements 5, Without Installing the Flash Player and Adobe Reader programs on the Elements 5 CD.  The Elements 5 Setup Wizard does not appear to offer an option to "uncheck" or otherwise prevent the Flash Player and Adobe Reader programs from being installed.  It is not desirable to install and then uninstall the unwanted Flash Player and Adobe Reader programs.  It is also not desirable to purchase a newer version of Elements at this time.

    If you cancel out of the Setup Wizard and then go to Start>Computer and right click on the cd and choose explore, you should be able to go to the folder
    that has photoshop elements 5 and run the Installer or Setup.exe and bypass all the other out of date stuff like flash and adobe reader.
    Also, after installing pse 5 you'll want to apply the 5.02 patch so pse 5 runs better on windows 7.
    (it says for vista, but works on windows 7 x64 as well)
    http://www.adobe.com/support/downloads/detail.jsp?ftpID=3569

  • Trying to choose a gaming imac configuration--on a budget

    I'm looking to get a gaming imac, and I'm on a budget. I enjoy RTS games, as well as Diablo-esque games, etc., but not shooters, and was thinking about going the bootcamp route. Initially, I thought about the 20" intel double core with 2 gb and 256 mb ATI video card, but it was a little too pricey for me, all told.
    So my question is this, which do you think has a bigger impact on gaming performance, 1 gb vs 2 gb memory, or a 128 vs 256 video card?
    And is there a substantial difference between these three configurations: 17" 1 Gb and 128 ATI, 17" 2 Gb and 128 ATI, or 20" 1 Gb and 256 ATI?
    Thanks!

    I dont know if Apple is the way you want to go if you want to do intense gaming currently. EA and Blizzard are however, moving games into the Apple realm now with Starcraft 2, Starcraft, World of Warcraft, (Diablo maybe, I dont remember). I can tell you now, that when later games will be coming out (even within this year), theres going to be a HUGE jump in system requirements, especially for games like SC2. The 256 vid card will be noticably faster and capable of handling more compared to the 128. As for memory, I like ot think of it as ram in a car, the amount of load it is capable of pulling without slowing effects. So, it would depend on the game. Something like Diablo and Starcraft/Brood War aren't too ram hungry, but when you go into the full on 3D, hardcore physics games, you will feel the need for it. There are a few things you should consider though before buying one. First, there are rumours that the iMac will undergo updates following the MacBook Pro hardware updates. This means, faster, stronger, more up-to-date stuff like Vid Cards may become available soon enough, if i recall correctly, they assumed anywhere from this month to october for it to happen. The rumours also state that the 17 inch iMac will be given up and will only be left with the other 20inch and up models. This will reduce the cost of the 20 inch. Also, memory can definitly be bought aftermarket to save you a lot of money. Of course it may not be the same speed settings as the memory sold with macs, but it can definitly save you $$. I got two 1G sticks for a total of 130$ canadian. which is about 50% differant than Apple's. If I had total absolute power over your buying descision (which I obviously dont :P) I would either go PC or simply wait to see if the iMac updates will occur. Both methods theoretically should save money. ^^

Maybe you are looking for

  • Can't get past Terms of Use

    I'm trying to download Acrobat XI free trial to my MacBook Pro. First step is to accept the terms of use. But it will only let me scroll part of the way down. It stops me at 24.9, so I can't get to the box to check to indicate I accept the terms of u

  • Unable to complete upload to ftp host

    Hi I am uploading my site to my web address but since updating to latest version I am unable to complete the upload. I can upload to the adobe site OK but not to my own site. I have deleted all the pages etc. but this is as far as I get. Any help wou

  • 5/28/2014 - Beta - AIR 14.0.0.103

    Adobe AIR Beta Channel Update This beta release provides access to the latest AIR runtime and SDK (with compiler) for Windows, Mac OS, iOS and Android.  You can download the AIR beta here: Download Adobe AIR 14 Beta - Adobe Labs Below are some of the

  • Matching RAW does not work.

    I've recently "upgraded" to Aperture, from just basic folders. I imported some 400 pictures the other day, but only the jpeg versions. Now, two weeks later I wanna match the RAW files. So I have the raw files available. Press import. Then I mark the

  • Keynote Audio

    I am having trouble with the audio (imported music from iTunes) starting and stopping throughout the presentation. It does it on both my iBook and my iMac. I have it set to loop. Thanks, Evelynn