| Author |
Message |
CCope
Newbie
Joined: 16 Jun 2008
Location: United States
Online Status: Offline
Posts: 4
|

Topic: removing character returns Posted: 16 Jun 2008 at 6:28am |
Hi,
I'm fairly new at this, but trying to remove what appears to be a carriage return and/or line feed at the end of each line, they appear as little boxes when we export to text document?
How do we also state which character position to start each column and how many characters are in each column?
|
|
Ccopes
|
IP Logged |
|
|
|
twinkle
Newbie
Joined: 16 Jun 2008
Location: United Kingdom
Online Status: Offline
Posts: 32
|

Posted: 16 Jun 2008 at 11:43am |
|
|
IP Logged |
|
BrianBischof
Admin Group
Joined: 09 Nov 2006
Online Status: Offline
Posts: 2458
|

Posted: 16 Jun 2008 at 2:10pm |
Trim is a good idea, but it only removes spaces from the end of the line. To get rid of the CR-LF characters, use the Left() function. A formula like this is probably be what you need. Left({table.field}, Len({table.field})-2);This uses the length of the field to determine how many characters to return. Thus, it chops off the last two characters from the field. I have three full chapters about writing formulas in my Encyclopedia book. You can find out more about my books at
Amazon.com
or reading the Crystal
Reports eBooks online.
|
|
Please support the forum! Tell others by linking to it on your blog or website:<a href="http://www.crystalreportsbook.com/forum/">Crystal Reports Forum</a>
|
IP Logged |
|
CCope
Newbie
Joined: 16 Jun 2008
Location: United States
Online Status: Offline
Posts: 4
|

Posted: 17 Jun 2008 at 5:39am |
Good Morning,
Thanks for taking the time to help me.
But when I use Left({table.field}, Len({table.field})-2)
it tells me it needs a string?
Left({bank_check.bc_dt}, Len({bank_check.bc_dt})-2)
What shall I do next?
|
|
Ccopes
|
IP Logged |
|
twinkle
Newbie
Joined: 16 Jun 2008
Location: United Kingdom
Online Status: Offline
Posts: 32
|

Posted: 17 Jun 2008 at 8:36am |
try... If NumericText (Mid(({bank_check.bc_dt}, 2,1}) = true
then Left({bank_check.bc_dt}, Len({bank_check.bc_dt})-2)
|
IP Logged |
|
CCope
Newbie
Joined: 16 Jun 2008
Location: United States
Online Status: Offline
Posts: 4
|

Posted: 17 Jun 2008 at 1:48pm |
Hi There,
Thanks again, but now it asks me for a ) see below colored area, then when I insert it, more ) are requested and so on.
If NumericText (Mid(({bank_check.bc_dt}, 2,1}) = true
then Left({bank_check.bc_dt}, Len({bank_check.bc_dt})-2)
Help!
|
|
Ccopes
|
IP Logged |
|
twinkle
Newbie
Joined: 16 Jun 2008
Location: United Kingdom
Online Status: Offline
Posts: 32
|

Posted: 17 Jun 2008 at 2:36pm |
try this..
If NumericText (Mid({bank_check.bc_dt}, 2,1}) = true
then Left({bank_check.bc_dt}), Len({bank_check.bc_dt})-2)
if this doesnt work then trial and error
also look at the other functions such as Stringvar etc
!
Ps im still looking for someone that knows how to Rank!
Edited by twinkle - 17 Jun 2008 at 2:46pm
|
IP Logged |
|
BrianBischof
Admin Group
Joined: 09 Nov 2006
Online Status: Offline
Posts: 2458
|

Posted: 17 Jun 2008 at 2:58pm |
It appears that you are the fields you are trying to remove a CR LF from are not strings. Thus, there shouldn't be a CR-LF character in them. I think your problem might be related to something else then. Re the new code you posted and the error message, I don't see how this code will help you because the field is either a string or not a string. But anyway, the error is because you have a "}" where you should have a ")" right after the ",2,1" part on the first line. Also, you have two parentheses after the "Mid". I don't know why this is b/c there should only be one. If NumericText (Mid({bank_check.bc_dt}, 2,1)) = true
then Left({bank_check.bc_dt}, Len({bank_check.bc_dt})-2)
|
|
Please support the forum! Tell others by linking to it on your blog or website:<a href="http://www.crystalreportsbook.com/forum/">Crystal Reports Forum</a>
|
IP Logged |
|
CCope
Newbie
Joined: 16 Jun 2008
Location: United States
Online Status: Offline
Posts: 4
|

Posted: 18 Jun 2008 at 10:22am |
Thanks for the tip.
I'm still unable to get this to work though.
I'm trying to export this report into an ascii format and it is creating an extra line inbetween the info as well as creating a space starting at the second line and so on. And it is giving me spaces in between each item, I would like to specify where to start for each item and where to end for each item so there are no spaces.
Any one know what I should do?
Example:
005555555555 00 000055555 0000000000555555 06102008 005555555555 00 000055555 0000000000555555 06102008 005555555555 00 000055555 0000000000555555 06102008 005555555555 00 000055555 0000000000555555 06102008 005555555555 00 000055555 0000000000555555 06102008
Edited by CCope - 18 Jun 2008 at 10:23am
|
|
Ccopes
|
IP Logged |
|
|
|