INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Jobs

CSV export of field problem

CSV export of field problem

(OP)
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!


RE: CSV export of field problem

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

RE: CSV export of field problem

(OP)
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

RE: CSV export of field problem

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

RE: CSV export of field problem

(OP)
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...

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Resources

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close