# HG changeset patch # User František Kučera # Date 1557241387 -7200 # Node ID 54716ea44d521ec81eec21d4c9bdd1507e8ef9dc # Parent 4e8fe4cc70f0e1330626eafc75ab79f4571f3eae pass only values to the awk process diff -r 4e8fe4cc70f0 -r 54716ea44d52 src/AwkHandler.h --- a/src/AwkHandler.h Tue May 07 16:38:12 2019 +0200 +++ b/src/AwkHandler.h Tue May 07 17:03:07 2019 +0200 @@ -257,20 +257,14 @@ void attribute(const string_t& value) override { if (currentRelationConfiguration) { - string_t variableName = a2v(currentReaderMetadata[currentAttributeIndex].getAttributeName()); - string_t variableValue = escapeAwkValue(value); - currentAttributeIndex++; currentAttributeIndex = currentAttributeIndex % currentReaderMetadata.size(); - // TODO: just the value – move name to the AWK function - std::string variablePair = convertor.to_bytes(variableName + L"=" + variableValue); + std::string awkValue = convertor.to_bytes(escapeAwkValue(value)); + if (currentAttributeIndex == 0) awkValue += "\n"; + else awkValue += "\t"; - if (currentAttributeIndex == 0) variablePair += "\n"; - else variablePair += "\t"; - - write(awkInputWriterFD, variablePair.c_str(), variablePair.length()); - + write(awkInputWriterFD, awkValue.c_str(), awkValue.length()); } else { relationalWriter->writeAttribute(value); }