in reply to Alt + Enter

What about accessing Excel directly?. I'm using WIN32::OLE, and the following code gives me a multi-line-entry in an Excel-cell:

$WPsheet->Range("B2")->{'Value'} = "This is\na test.";

Rata

Replies are listed 'Best First'.
Re^2: Alt + Enter
by rpike (Scribe) on Mar 24, 2011 at 13:57 UTC
    Not using a module (not my decision). It's a tab-delimited file - i.e. open file handle and print tab-delimited strings to it. It "mainly" gets opened by Excel is all. If there was a way to print alt+enter equivalent or something for Excel it'd be great. The file can have some stuff for Excel in it (can be removed by text editor) but should be formatted in case of import in Excel.
      You cannot put newlines, or tabs, in a cell, in tab delimited files. It comes with the territory.

      You could upgrade to a CSV file (possibly even using a tab as the column delimiter), which allows you to quote cell contents and thereby including newlines.

      You could also try to just use a standalone return ("\r") in the tab delimited file. No garantees, it could work, but it's an extremely dangerous hack — you never know if somebody editing the file in a text editor could ruin it for you.