openoffice-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Girvin Herr <girvin.h...@sbcglobal.net>
Subject Re: Basic Macro – write a file
Date Sat, 23 Nov 2013 00:19:25 GMT
Johnny,
Looks like your file was created on a *nix machine, which uses only a 
linefeed (0x0a) as a line terminator.  What you want is a DOS/Windows 
line terminator of carriage return-linefeed (0x0d 0x0a).
I use dos2unix to convert such files:
     http://sourceforge.net/projects/dos2unix/
dos2unix is actually two programs, or filters.  One changes CR-LF to LF 
(dos2unix) and the other changes LF to CR-LF (unix2dos). Although I use 
Linux, this package uses stdin and stdout (redirection is implied), so 
it should compile and run with any machine that has a C compiler.

Hope this helps.
Girvin Herr



On 11/22/2013 03:41 PM, Johnny Rosenberg wrote:
> Dim iNumber As Integer
> iNumber = Freefile
> Open sFilePath For Output As #iNumber
> Print #iNumber, "Line 1"
> Print #iNumber, "Line 2"
> Close #iNumber
>
>
> The file now looks like this (in hex values):
> 4C 69 6E 65 20 31 0A
> 4C 69 6E 65 20 32 0A
>
> So every line ends with 0A (Chr(10)).
> The file is going to be in a special text file format suited for a specific
> app, so I need every line to end with 0D 0A (Chr(13) & Chr(10)). Is that
> possible? How? Can I see a short example of that, that creates a text file
> that looks like the following?
> 4C 69 6E 65 20 31 0D 0A
> 4C 69 6E 65 20 32 0D 0A
>
>
>
> Regards
>
> Johnny Rosenberg
>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@openoffice.apache.org
For additional commands, e-mail: users-help@openoffice.apache.org


Mime
View raw message