Page 2 of 2

Posted: Wed Sep 15, 2010 8:08 am
by priyadarshikunal
I don't really know the details but here you can trim the output using below code:

Code: Select all

Trim(<value>,',','B')
However in case the record delimiter is set a ',' it should work.

Posted: Wed Sep 15, 2010 8:25 am
by pravin1581
Sainath.Srinivasan wrote:Isn't that what you asked for ? Trim the trailing comma.
When I am trying to read that file in a separate job where I can trim that trailing comma, i am able to trim the last comma and getting the desired output but the job throws warning like Missing Record delimiter '''', saw EOF instead, and moreover I wanted to achieve this in a single job instead of 2 jobs.

Posted: Wed Sep 15, 2010 5:29 pm
by ray.wurlod
So put the "trim the trailing comma" logic into the first job.

Posted: Thu Sep 16, 2010 2:20 am
by Sainath.Srinivasan
How do you intend to use this file in the downstream process ?

In the place you read the file, mention record delimiter as 'none' and work with the plan that there is an extra comma. No need to worry about it.

Posted: Thu Sep 16, 2010 3:21 pm
by pravin1581
ray.wurlod wrote:So put the "trim the trailing comma" logic into the first job. ...
I am getting the comma separeted values when I am collecting the data in the file in the first job, hence I cannot trim the trailing comma there.

Posted: Thu Sep 16, 2010 3:22 pm
by pravin1581
Sainath.Srinivasan wrote:How do you intend to use this file in the downstream process ?

In the place you read the file, mention record delimiter as 'none' and work with the plan that there is an extra comma. No need to worry about it.
I have tried all the different options while reading the file in the next job, but it always throws the warning. I am getting the desired output put the warning is bugging me.

Posted: Fri Sep 17, 2010 2:44 am
by Sainath.Srinivasan
Did you try 'record delimiter = none' ?

Posted: Tue Sep 21, 2010 2:26 pm
by pravin1581
Sainath.Srinivasan wrote:Did you try 'record delimiter = none' ?
Tried out all the options but cannot get rid of the warning.

Posted: Tue Sep 21, 2010 2:31 pm
by anbu
Can you post the warning message?

Posted: Tue Sep 21, 2010 3:08 pm
by victor236
pravin1581 wrote:
Sainath.Srinivasan wrote:Read the source and write an output with record delimiter as comma
Thanks Sai. I tried this , the output is coming as 1,2,3,4,
Hi Pravin,

I am looking at this thread which seems to be important and may be useful any time.

Can you tell me how did you try this, did you try this with the pivot stage?
I am using Server job on windows server where I could not get the result what you posted. Just seeking some help to try this.

similar requirement

Posted: Fri Oct 01, 2010 5:22 pm
by UAUITSBI
pravin1581 wrote:
arunkumarmm wrote:Or even in a simpler way, create a stage variable like this:

sv1 = sv1 : ',' : InputColumn

and map it to the target column derivation.

The last output row will have all the values...
This doesn't works . The output is coming as 0,0,0,0,
Hi,
Can you tell me how did you define your Stage Variable exactly?I am getting the same result with 0's in output column

Re: Multiple rows to single row comma separated values

Posted: Fri Oct 01, 2010 10:08 pm
by reachmexyz
Try unix commad
paster -s -d, source_file > Target_file

Posted: Tue Oct 05, 2010 3:04 am
by Phani01
So Pravin, What was the logic you implemented.

Could you please let us know.

Posted: Mon Nov 14, 2011 1:03 pm
by marpadga18
pravin1581 wrote:
Sainath.Srinivasan wrote:Read the source and write an output with record delimiter as comma
Thanks Sai. I tried this , the output is coming as 1,2,3,4,
Hi could you tell me how you did you get it? I have same thing to do.
I did with stage variable logic but it is giving
0
0
0
0
could you corrcet me where I am doing worng?
Thanks M

Posted: Mon Nov 14, 2011 1:14 pm
by marpadga18
arunkumarmm wrote:
pravin1581 wrote:This doesn't works . The output is coming as 0,0,0,0,
This should work. May be try defining the initial value of your stage variable to '' {Empty}

If you are mapping the column properly, how come this doesnt work? No complex thing involved in this. You are just appending your column to the stage variable. I have did this before and it worked. All you need to do is to check if everything is setup properly.
Hi Arun I did this but I am also getting 0,0,0,0,0, data is not comming. I tried your data as example could you tell me were I am doing wrong?

sv1 = sv1 : ',' : Inputcolumn