Page 1 of 2

new line character as deimiter

Posted: Sun Nov 07, 2010 5:04 pm
by raji33
Hi,

Can we use new line character as delimiter?

If yes, can anyone please suggest me how to use the \n as delimiter.

Thanks in advance

Posted: Sun Nov 07, 2010 8:08 pm
by chulett
What kind of delimiter - field, record? Where?

A UNIX newline is a CHAR(10), by the way, depending on the 'where' you can use that function or perhaps the value '010' by itself.

Posted: Mon Nov 08, 2010 9:35 am
by raji33
Hi craig,

I have actually used the filter command in sequential file i used this command

tr -s "\n" ','

but it is saying error in command

Posted: Mon Nov 08, 2010 9:56 am
by anbu
What is your record delimiter?

Posted: Mon Nov 08, 2010 11:27 am
by raji33
, is my record delimiter

Posted: Mon Nov 08, 2010 11:39 am
by nitkuar
I guess you are looking for the usage of UNIX newline as record delimiter.

Posted: Mon Nov 08, 2010 11:45 am
by anbu
Can you show your input?

Posted: Mon Nov 08, 2010 12:06 pm
by raji33
ya your right my input is jill file

insert_job: template
job_type:c
command: ls -l
machine: localhost
owner: lyota01@TANT-A01
days_of_week: all
description: "description field"
std_err_file: /tmp/std_err


this by filter commnad iam changing,nelinw as ,
with filter command in sequential file
tr -s '\n' ','

Posted: Mon Nov 08, 2010 12:07 pm
by raji33
ya your right my input is jill file

insert_job: template
job_type:c
command: ls -l
machine: localhost
owner: lyota01@TANT-A01
days_of_week: all
description: "description field"
std_err_file: /tmp/std_err


this by filter commnad iam changing,nelinw as ,
with filter command in sequential file
tr -s '\n' ','

Posted: Mon Nov 08, 2010 12:13 pm
by nitkuar
Just curious, why do you want to first convert newline to ',' character and then want to use ',' character as record delimiter.

Simply use UNIX newline as record delimiter without any substitution.

Posted: Mon Nov 08, 2010 12:17 pm
by anbu
Simple tr command wont work for your case. Because tr converts entire input file into a single line where all fields and records are separated by comma.

Do you all 8 fields in all the records?

Posted: Mon Nov 08, 2010 12:20 pm
by raji33
sorry for the confussion nitkaur newline is not , i dont know exactly what it is but what ever it may be iam converting that to , by using that command in filter

Posted: Mon Nov 08, 2010 12:23 pm
by raji33
yes anbu that what exactly i want then in transformaer i will use field function and pick the 2nd field

Posted: Mon Nov 08, 2010 12:26 pm
by nitkuar
raji33 wrote:i dont know exactly what it is but what ever it may be iam converting that to , by using that command in filter
if you don't know exactly what it is, then how could you substitute it with another character. :wink:

Did you try using my other solution.

Posted: Mon Nov 08, 2010 12:34 pm
by raji33
you may be right but iam idea was i want complete input to come in oneline

saylike this

Job type command machine
nsert_job: template job_type:c command: ls -l machine: localhost

now in transformer Field(inputcolumn,':',2)

this will be iam derivation

and i have implemented in 8.01 version but i dnt know y iam getting these errors in 7.5