Help with linefeeds.

  • Thread starter Thread starter Wade G. Pemberton
  • Start date Start date
W

Wade G. Pemberton

I've used javascript to format a lot of repetitive data on an web page
input FORM into one long string for submission to the server.
The format is multiple lines of comma delimited data. When viewed
with any text reader, the text looks fine, and MS Excel will import the
data into the correct columns, but leaves a blank row between every
filled row, despite the fact that the text file has no blank rows.

The problem appears to be the linefeed that splits the string into
seperate lines in the text file. I've used the javascript special
character "\n" to do the linkbreak, but have also tried "\r" and even
the window's unique line break, "\r\n". No avail. The browsers have
no trouble with any of the linebreaks, the Unix server dutifully makes a
nice, tight easily readible text file no matter which is used, and
Excel fails to import any of them without the blank rows problem.
Additonally, when in the double row funk, Excel refuses to import any
subsequent text files. (the Import Text File is grayed out on the
menu).

This must be a common problem. I expect Excel can surely handle
linefeeds in text files and I've just not found the right checkbox. My
handiness on Excel is limited to mathematical manipulation of
columns/rows, not macros to eliminate linefeeds.

Help please.

Wade
 
I think I'd fix it after I imported it into excel.

Can you pick out a column that always has data in it if the row is used?

If yes, select that column
edit|goto (or F5 or Ctrl-g)|Special
click blanks (and ok)

Right click on one of the selected cells and select Delete.
Tell it you want the entire row deleted when prompted.

I don't speak javascript, but if you're interested in determining the problem,
you could open your text file in a hex editor and see how each line ends. I
suspect that there's more than the carriage return/linefeed that DOS/Windows
programs expect.
 
Back
Top