\n not working properly

Hi all,

I'm trying to generate a series of txt files starting from a plain csv file

part of my code:

#!/bin/ksh

INSTALLDIR=/Users/ME/Installdir
CSV=CSV.csv
TMP=/tmp/$(basename $0).txt
tr -s "\r" "\n" < /$INSTALLDIR/$CSV > $TMP
function  Makefiles
{
	printf '%24s:%30s\n' "sometext"
   	printf '%24s:%30s\n' "somemoretext" "$1"
        etc...
}

Problem lies in the \n of the printf bit.
I'm running this script in OSX to generate the files needed, but they're to be used in a winXP program. They generate fine in OSX but when I open them in winXP using notepad or something alike, every "new line" I should be getting is replaced by this vertical rectangle (don't know how it's actually called, but you can see them e.g. in fonts not covering all writing symbols).
Needless to say I get all my text on one line with a rectangle in between, instead of on two lines.

Any idea how to get this solved?
thanks in advance!

The problem is that Windows linefeeds look like: \r\n while unix ones are like \n. Try substituting every \n with \r\n in your code or you can use gVim on windows to view unix files properly.