Welcome to SPN

Register and Join the most happening forum of Sikh community & intellectuals from around the world.

Sign Up Now!

Delete carriage returns

Discussion in 'Information Technology' started by kayabob, Jul 28, 2006.

  1. kayabob

    kayabob
    Expand Collapse
    Guest

    I have some fields where someone has used carriage returns with data entry.
    Now, I need to export this data into a flat text file, and these carriage
    returns are obviously messing up the record layout. Is there any way to
    delete these carriage returns from my Access fields before I export to a text
    file?
     
  2. Loading...


  3. fredg

    fredg
    Expand Collapse
    Guest

    On Wed, 24 May 2006 10:06:02 -0700, kayabob wrote:

    > I have some fields where someone has used carriage returns with data entry.
    > Now, I need to export this data into a flat text file, and these carriage
    > returns are obviously messing up the record layout. Is there any way to
    > delete these carriage returns from my Access fields before I export to a text
    > file?


    If your version of Access supports the Replace Function, you can run
    an update query to replace all of the returns (with what?)
    This Update query replaces the returns with a single space.
    Use "" if you want to replace the returns with nothing.

    Back up your table first.

    Update YourTable Set YourTable.FieldName = Replace([FieldName],chr(13)
    & chr(10)," ");
    --
    Fred
    Please respond only to this newsgroup.
    I do not reply to personal e-mail
     
  4. kayabob

    kayabob
    Expand Collapse
    Guest

    I tried this but got a message: "6441 conversion failures due to type
    conversion". 6441 seems like it might be about the right # of carriage
    returns found. I was trying to replace the carriage return with 2 spaces.

    "fredg" wrote:

    > On Wed, 24 May 2006 10:06:02 -0700, kayabob wrote:
    >
    > > I have some fields where someone has used carriage returns with data entry.
    > > Now, I need to export this data into a flat text file, and these carriage
    > > returns are obviously messing up the record layout. Is there any way to
    > > delete these carriage returns from my Access fields before I export to a text
    > > file?

    >
    > If your version of Access supports the Replace Function, you can run
    > an update query to replace all of the returns (with what?)
    > This Update query replaces the returns with a single space.
    > Use "" if you want to replace the returns with nothing.
    >
    > Back up your table first.
    >
    > Update YourTable Set YourTable.FieldName = Replace([FieldName],chr(13)
    > & chr(10)," ");
    > --
    > Fred
    > Please respond only to this newsgroup.
    > I do not reply to personal e-mail
    >
     
  5. Rick Wannall

    Rick Wannall
    Expand Collapse
    Guest

    Can you post the line(s) of code that you're using to do this,please.

    "kayabob" <kayabob@discussions.microsoft.com> wrote in message
    news:37CDC8C5-88F0-4D18-8B12-D0D5D115D459@microsoft.com...
    >I tried this but got a message: "6441 conversion failures due to type
    > conversion". 6441 seems like it might be about the right # of carriage
    > returns found. I was trying to replace the carriage return with 2 spaces.
    >
    > "fredg" wrote:
    >
    >> On Wed, 24 May 2006 10:06:02 -0700, kayabob wrote:
    >>
    >> > I have some fields where someone has used carriage returns with data
    >> > entry.
    >> > Now, I need to export this data into a flat text file, and these
    >> > carriage
    >> > returns are obviously messing up the record layout. Is there any way
    >> > to
    >> > delete these carriage returns from my Access fields before I export to
    >> > a text
    >> > file?

    >>
    >> If your version of Access supports the Replace Function, you can run
    >> an update query to replace all of the returns (with what?)
    >> This Update query replaces the returns with a single space.
    >> Use "" if you want to replace the returns with nothing.
    >>
    >> Back up your table first.
    >>
    >> Update YourTable Set YourTable.FieldName = Replace([FieldName],chr(13)
    >> & chr(10)," ");
    >> --
    >> Fred
    >> Please respond only to this newsgroup.
    >> I do not reply to personal e-mail
    >>
     

Share This Page