Welcome to SPN

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

Sign Up Now!
  1.   Become a Supporter    ::   Make a Contribution   
    Target (Recurring Monthly): $200 :: Achieved: $98

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
    >>
     
Since you're here... we have a small favor to ask...

More people are visiting & reading SPN than ever but far fewer are paying to sustain it. Advertising revenues across the online media have fallen fast. So you can see why we need to ask for your help. Donating to SPN's is vote for free speech, for diversity of opinions, for the right of the people to stand up to religious bigotry. Without any affiliation to any organization, this constant struggle takes a lot of hard work to sustain as we entirely depend on the contributions of our esteemed writers/readers. We do it because we believe our perspective matters – because it might well be your perspective, too... Fund our efforts and together we can keep the world informed about the real Sikh Sikhi Sikhism. If everyone who writes or reads our content, who likes it, helps us to pay for it, our future would be much more secure. Every Contribution Matters, Contribute Generously!

    Become a Supporter      ::     Make a Contribution     



Share This Page