Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

CSV export of field problem

Status
Not open for further replies.

JasonKaufman

Programmer
Apr 13, 2006
46
US
I am needing to create a CSV file using a long description field that can be of various lengths and could look something like the following bold type:

bt boys basics gry 0-6 months

Product Testing Required-CPSIA Protocols-Lead in Substrates Section 101 CPSIA, Phthalates Section 108 CPSIA:
R3149 (Navy & White), H311-15, Pass, exp. 4/13/16

data data data data data data


When I export this field it remains looking like above and rather than being 1 line of data, it is multiple rows.
I need to have this data to be on the same row as the rest of the pulled product data.
Then have an indication in that extracted data for the carriage return when needed.

Final data would look like below (but without the wrapped text):

bt boys basics gry 0-6 months<CR><CR>Product Testing Required-CPSIA Protocols-Lead in Substrates Section 101 CPSIA, Phthalates Section 108 CPSIA:<CR>R3149 (Navy & White), H311-15, Pass, exp. 4/13/16<CR><CR>data data data data data data

where <CR> is the indicator (can certainly be different) for when a carriage return occurs.

Thanks!


 
Have you tried replacing the return while in Crystal? E.g.,

Replace({table.field},chr(13)," x ") //"space x space" to indicate a return was removed

-LB
 
I tried "Replace({product1.long-description},chr(13)," x ")"
and the data now look like:

0031431242|bt boys gry x
x
Product Testing Required-CPSIA Protocols-Lead in Substrates Section 101 CPSIA Phthalates Section 108 CPSIA: x
R3149 (Navy & White) H311-1563 Pass exp. 4/13/16

I would need it to look like the example i just updated on the main post
 
I am confused by the appearance of a series of numbers that were not in the original example.

It's possible you have the code for line feed in there too, so try this instead:

Replace(Replace({table.field},chr(13),'<CR>'),chr(10),'<LF>')

-LB
 
sorry lbass...i had included the output showing the productcode then the description in my output.

I took your 2nd formula and tweaked it a little so now it is
Replace(Replace({table.field},chr(13),''),chr(10),'<CR>')

Thanks much for your help!

The next problem ends up being when this long piece of text is sent as a csv file, the data does not remain as part of one column of data, rather it is spread out over columns A-E.
any ideas on how to make it stay in column A?


Nevermind...i got it working...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top