Nov 24

Once you have opened your Excel file you are probably going to want to access sheets within that file.

The Workbook class contains methods to access sheets by index or by name as shown in the following examples.

int nsheets = workbook.getNumberOfSheets();
for (int i=0; i<nsheets; i++) {
    Sheet sheet = workbook.getSheetAt(i);
				
    // Now you can access the sheet
}

And to access a sheet by name.

Sheet sheet = workbook.getSheet(sheetName);

Stay tuned as we continue to investigate using POI.

written by objects \\ tags: , , ,

Nov 24

We were recently setting up an automated data transfer for a client. Standard sort of thing with a file being periodically copied from one server to another, then processed on that server. When we tested it we found the processing was failing.

Closer investigation revealed the issue was that the file transferred from client server was using UTF-16 encoding and the processing was UTF-8. There was no need for the files to be in UTF-16 so the solution was to convert them to UTF-8. To achieve that we used the iconv utility using the following syntax


iconv --from-code UTF-16 --to-code UTF-8 input_utf16.xml > output_utf8.xml

written by objects \\ tags: , ,

Nov 23

When you plugin your iPhone (or iPod touch) into your Mac either iPhoto or Aperture get automatically launched. Reason for this is so any photos can be imported from the iPhone to your Mac.

You can disable this (or change the application that is started) using the “Image Capture” application (located in the Applications folder). Start up Image Capture and select your iPhone in the Devices list. Once thats done you should have a drop down at the bottom of the list that allows you to select which application you want to automatically launch whenever the iPhone is plugged in.

Hope you find this useful.

written by Obiweb \\ tags: , , , ,