Home General
New Blog Posts: Merging Reports - Part 1 and Part 2

How to get rid of quotation marks

edited August 2002 in General
I have a comma delimted text file but each field is offset with question
marks ... for example "customer","customer ID","address" etc. ... when I
use the ppTextPipeline and set the delimiter as a comma, the quotations show
up on the report ... I can get rid of them with code but I want my end users
to be able to do this ... is there a way to omit the quotes within the
textpipeline or report setup? thanks, LL

Comments

  • edited August 2002
    You'll have to modify the source to 6.03 for this to work this way. This
    has been added as a property of the txt pipeline for the next release of RB.

    {---------------------------------------------------------------------------
    ---}
    {function TppFileDataStream.GetFieldAsString}

    function TppFileDataStream.GetFieldAsString(aFieldName: String): String;
    var
    liIndex: Integer;
    liResultLength: Integer;
    begin

    liIndex := GetFieldStringIndex(aFieldName);

    if (liIndex >= 0) then
    Result := FFieldStrings[liIndex]
    else
    Result := '';

    {here is the new code}
    if FRemoveSurrondingQuotes then
    begin

    liResultLength := Length(Result);

    if (liResultLength > 1) then
    begin
    if (Result[1] = FQuoteChar) and (Result[liResultLength] =
    FQuoteChar) then
    Result := Copy(Result, 2, liResultLength-2);

    end;

    end;


    end; {function, GetFieldAsString}




    Cheers,

    Jim Bennett
    Digital Metaphors

This discussion has been closed.