How do I get Excel 2008 to save text file formats with LF instead of CR?

MS EXCEL

    Sponsored Links

    Next

  • 1. Matching data from one spreadsheet to another
    Hi, How do I match one data from one spreadsheet (A) with another (B) row by row and then delete on spreadsheet (A) the data row that matches a row from two columns in spreadsheet B? catlair
  • 2. Mac Excel 2004 VBA Watch window
    How do you get the Watch window to open up when using VBA in Mac Excel 2004? I want to be able to monitor the values of various variables.
  • 3. VLOOKUP For Pictures?
    Is it possible to look up the value in a cell, and depending on that display a small graphic from a table elsewhere in the spreadsheet. At the moment, I have a small "system" which when a user picks a value from a combo box, it is then put into a cell, then a cell that is located next to the drop down displays a description of the product. It does this by looking up the value that's stored in the cell, within a VLOOKUP statement. Is it possible to do this with photographs - could I include a small photograph of the product? TIA For any help -- Dan Walters
  • 4. Macro Code in Pocket Excel
    Please clarify how to embed sheet code into Pocket Excel. Have not found a way as yet. Thanks,
  • 5. VLOOKUP For Pics
    Is it possible to look up the value in a cell, and depending on that display a small graphic from a table elsewhere in the spreadsheet. At the moment, I have a small "system" which when a user picks a value from a combo box, it is then put into a cell, then a cell that is located next to the drop down displays a description of the product. It does this by looking up the value that's stored in the cell, within a VLOOKUP statement. Is it possible to do this with photographs - could I include a small photograph of the product? TIA For any help Dan Walters

How do I get Excel 2008 to save text file formats with LF instead of CR?

Postby mccoma » Sun, 11 Jan 2009 06:55:40 GMT

Version: 2008
Operating System: Mac OS X 10.5 (Leopard)
Processor: Intel

How do I get Excel 2008 to save text file formats with LF instead of CR? LF is the line ending character on OS X and UNIX. CR is from OS 9 and earlier. Is there a way to force Excel to use LF instead of CR. The extra conversion step is a pain.

Similar Threads:

1.import text-file - strings contain cr-lf

I have a text-file I wish to import into an Excel spreadsheet.

This file's data-fields are comma-separated.  Data-fields which contain text
are quote-delimited .... but the text-data-fields can contain CR-LF.

Excel's Data > Get External Data > Import Text File menu option will see
each such CR-LF as starting a new row -- which I don't want.

Has anyone worked-up a solution for this kind of import problem ?


2.Checking for CR/LF in text file.

Hi Guys,

Does anyone know how I would check that each line of a text file is
terminated with a CR/LF pair?

My macro needs to check the formatting of each line of a CSV file to
make sure it will load properly into a different application (This
part is nice and easy).  Because each record/line in the file is
transactional in nature Excel is perfect for this but the one quirky
thing is that each line in the file must be terminated with a CR/LF
pair.

Any help will be appreciated.

I've tried working with something like this but each method reads the
line before termination? -

...
  Set fs = CreateObject("Scripting.FileSystemObject")
  Set f = fs.OpenTextFile("C:\TEST.TXT", ForReading, TristateTrue)
  currentLine = f.ReadLine
...
and also
...
  Open "C:\TEST.TXT" For Binary As #1
  Line Input #1, LineofText
...

Cheers,
Deon Murtagh

3.Hint: one solution for reading excel files with embedded cr/lf

A solution I came up with to read embedded cr/lf in excel cells.
This is somewhat combersome and has not been tested for all possible
conditions.

Problem: excel spreadsheets contain cr/lf in some cells.
Solution: At least in the version I'm working with, DDE returns a double
quoute at the biginning and end of the field with the embedded cr/lf, so:

1. read only one cell at a time.
2. look for the leading " and if present (and not terminated by another "
at end) read another 'record' from the cell and append it to the previous
one.
3. continue 2 until a trailing " is found.
4. get rid of the double quotes.

The below code implements this in a macro which works for my particular
data. I put a blank in place of the cr/lf - something else could be used.
For simplicity, I also trhow away any embedded double quotes. You may need
to keep them.

Regards.
Dennis Diskin



%macro getall(col,var);
/* macro reads a column and checks for a leading double quoute */
/*  if dq found, reads and appends until trailing dq found */
/* eliminates dq's */
filename xls&col dde "EXCEL|Site Contact Information!R2C&col:R9999C&col";
infile xls&col dlm='09'X notab dsd missover end=eof&col lrecl=8000;
informat save col $100.;
length save col $ 100;

input col;
if substr(col,1,1) eq '"' then
  do;
    do while (substr(reverse(trim(col)),1,1) ne '"' or length(trim(col)) eq 1);
        input save;
        col = trim(col) || ' ' || save;
    end;
  end;
&var = compress(col,'"');
%mend;

OPTIONS NOXWAIT NOXSYNC;
x """f:\sample.xls""";
filename xlscmd dde 'excel|system';

data investig(keep=siteid last first city state title);
/* make sure Excel had time to open */
if _n_ eq 1 then
  rc=system('sleep(10)');

length siteid $12 last first title city $50 state $2;

%getall(1,siteid)
%getall(2,last)
%getall(3,first)
%getall(4,title)
%getall(8,city)
%getall(9,state)


if eof1 or eof2 or eof3 or eof4 or eof8 or eof9 then
  do;
    /* close excel */
    file xlscmd;
    put '[QUIT()]';
    put '[QUIT()]';
  end;
run;

4.Excel 2008 files getting "out of memory" or "cannot save" errors

Version: 2008
Operating System: Mac OS X 10.5 (Leopard)
Processor: Intel

Greetings -  <br><br>Based on my searches, I'm not sure I'll get any new answers, but it doesn't hurt to try.  <br><br>Situation: <br>
A couple of Excel 2008 files, that exist on a share on an Apple Xserve (10.4.11).  <br><br>The files are both largely just text in cells, with some formatting (outlines and shading). A few dates in cells. Zero formulas, no scripts. They consist of a few screen pages of info each.  <br><br>The files have never been touched by Windows Excel. <br><br>They do each contain one (1) linked, small graphic file (company logo), but the file used started out different for the two files. During troubleshooting, I've since had them update the graphics so they are the same.  <br><br>Multiple users access the files and save updates to them. Different users will see somewhat different errors but generally either "out of memory" or "cannot save" type messages. Almost all users are using Macbooks, either 10.4 or 10.5 current updates. All are using Office 12.2.3.  <br><br>I am currently unable to consistently reproduce the issue. I suspect the users see it particularly in these file merely because both are use/updated frequently. Some days users will have no issues, other days they might run into the issue several times a day.  <br><br>Any one seen similar issues, or have suggestions? <br><br>Thanks in advance.

5.Excel interpreting HTML and CR/LF

Hope this is the right newsgroup - just yell at me if not :

My ASP app allows users to save certain dynamic data as excel spreadsheets and the method I chose to accomplish this was to simply create an table in HTML with my data and tell the browser to use the excel mime type.  Works great - even little functions like SUM that you can you inside Excel directly.  My problem is there is a notes column in this dataset which contains line breaks for between paragraphs.  When Excel interprets <br>, <p>, etc it automatically creates a new row.  I need excel to honor those tags as it would if you were in the desktop application and used [alt] + [enter] to create a new line inside a single cell

Here's what I've tried so far
- vbscript's chr(10) and chr(13
- <br>, <p
- wrapping my text inside <p> text text </p> tag
- "# & 1 0 ;" and "# & 1 3 ;" w/o space

How can I tell Excel to not break CR/LF chars into a new row, and just stick with the table structure I give it?  Any leads are much appreciated.

6. Excel interpreting HTML and CR/LF (thanks)

7. need help re send/recieve com port data from excel and auto CR/LF

8. HTML to Excel from ASP; interpreting CR/LF



Return to MS EXCEL

 

Who is online

Users browsing this forum: No registered users and 75 guest