Bolte IT Consulting
Toggle Navigation
  • Home
  • Featured Articles
  • Tech Blog
    • Joomla CMS
    • Java SE / EE
      • JavaFX and e(fx)clipse
      • JAXB
      • Apache POI
      • Java SE
      • Java EE
    • HP ALM
      • HP ALM REST API
      • HP ALM Workflow VBScript
    • Useful Software
    • VB.NET
    • XML
    • Oracle Database
      • Oracle SQL
      • Oracle PL SQL
      • Oracle SQL Developer
    • VBA
      • Excel VBA
      • Access VBA
      • MS Office and VBA
      • Power Point VBA
    • MS SQL Server
    • Shortcuts
    • COBOL
    • SharePoint
    • SAP SQL Anywhere
  • Off Topic

Write a String into a text file

Whenever I have to write data into a text file following function has proven to fulfill my needs.

Source Code

In case you want to export a file in Unicode encoding you just hand True for the parameter isUtf16Le, which will cause the FileSystemObject to encode the file in UTF-16 with low byte order mark (little endian).

Last Updated: 05 January 2018
Hits: 26347

Find last row in Excel file using POI

If you have to determine the last row in a Microsoft Excel file you will face some trouble.

For whatever reason there is no reliable method available in Excel VBA to retrieve the last row with data. Since Microsoft developers seem to have decided to treat formatting and data the same way when it comes to determining the so called UsedRange in a worksheet, we are officially screwed.

Here is what POI developers are stating in their API docs regarding this problem :0).

"Gets the number last row on the sheet. Owing to idiosyncrasies in the excel file format, if the result of calling this method is zero, you can't tell if that means there are zero rows on the sheet, or one at position zero. For that case, additionally call getPhysicalNumberOfRows() to tell if there is a row at position zero or not." 

Found at http://poi.apache.org/apidocs/org/apache/poi/hssf/usermodel/HSSFSheet.html#getLastRowNum()

I fully agree: Excel's core implementation and resulting behavior is nuts many times.

Last Updated: 20 January 2016
Hits: 31366

Remove line breaks from Oracle column

If you want to remove line breaks or other characters from Oracle fields, the following article might help.

One scenario is for example export of data into text files.

SQL

1
translate(' example ', chr(10) || chr(13) || chr(09), ' ') 

The above will replace all line breaks (chr(10)), all tabs (chr(09)) and all carriage returns (chr(13)) with a space (' ').

The Oracle function 'translate' is applied on the whole String and might show better performance than regular expressions depending on the complexity of your regex.

Enjoy.

Last Updated: 28 September 2016
Hits: 25005
  1. Setup Eclipse for JAXB
  2. Java connect to SQL Anywhere database
  3. PL SQL for analyzing and rebuilding indexes
  4. Create an SQL Anywhere Database Service

Page 2 of 8

  • 1
  • 2
  • 3
  • 4
  • ...
  • 6
  • 7
  • 8
  • You are here:  
  • Home
  • Featured Articles

  • Privacy Policy
  • Imprint

Back to Top

© 2025 Bolte IT Consulting