View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.misc
Dave Peterson Dave Peterson is offline
external usenet poster
 
Posts: 35,218
Default Importing data to excel (newline/carriage return issue)

I think I'd try to change the tabs to spaces and the returns to a unique, unused
character in the DB2 file--but I don't know if that's even possible.

Then you could just import the data as-is and do a mass change to change that
unique character back to alt-enter when you open the file in excel.

If that's not possible...

If you just use File|Open and parse it as comma delimited, do you end up with a
line with 4 columns used, then some lines with just column A used, then a line
with 4 columns used, then more lines with just column A used?

Kind of like:

a b c d
x
y
z
a b c d
x
y
z
w

where each letter represents a cell?

Maybe you could just loop from the top to the bottom. If the row has 4 columns
used, don't touch it.

If the row only uses column A, then append that info (with an alt-enter) to
column D of the good row (and delete that crummy row).




Tandaina wrote:

Hello folks. Excel newbie here hoping for a point in the right
direction.

I'm a linux girl, I don't do Windows and know nothing about Excel so
please bear with me. I've been asked to solve a problem for my managers
so I'm delving into Excel.

We are exporting data from our DB2 database in roughly the following
format:

"Employee Name", "Date", "Task", "Employee's Task Comments"
"Employee Name", "Date", "Task", "Employee's Task Comments"
"Employee Name", "Date", "Task", "Employee's Task Comments"

You get the idea. The first three fields are not an issue. But that
last field is a free form text field in our application that can (and
usually does) include things like tabs and newline characters. When we
try to import this data into Excel the newlines in the comments field
cause a new row in Excel to be created. This is obviously not what we
want.

What my managers would like to see is the comments preserved the way
they would be seen in our application. IE one cell with tab and newline
characters maintained in that cell. I'm guessing there has to be away
to do this, perhaps when I'm doing the data import from the text file?
(I'm using Data-Import External Data and going throught the wizard.
So I can tell Excel that last field is " delimited text but it still
breaks the field on newlines.)

Any nudges in the right direction would be appreciated. Programming I
know, but Excel is a foreign tool and the help was less than useful.

Chris


--

Dave Peterson