new line character as deimiter

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

raji33
Premium Member
Premium Member
Posts: 151
Joined: Thu Sep 23, 2010 9:21 pm
Location: NJ

new line character as deimiter

Post 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
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post 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.
-craig

"You can never have too many knives" -- Logan Nine Fingers
raji33
Premium Member
Premium Member
Posts: 151
Joined: Thu Sep 23, 2010 9:21 pm
Location: NJ

Post 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
anbu
Premium Member
Premium Member
Posts: 596
Joined: Sat Feb 18, 2006 2:25 am
Location: india

Post by anbu »

What is your record delimiter?
You are the creator of your destiny - Swami Vivekananda
raji33
Premium Member
Premium Member
Posts: 151
Joined: Thu Sep 23, 2010 9:21 pm
Location: NJ

Post by raji33 »

, is my record delimiter
nitkuar
Participant
Posts: 46
Joined: Mon Jun 23, 2008 3:09 am

Post by nitkuar »

I guess you are looking for the usage of UNIX newline as record delimiter.
anbu
Premium Member
Premium Member
Posts: 596
Joined: Sat Feb 18, 2006 2:25 am
Location: india

Post by anbu »

Can you show your input?
You are the creator of your destiny - Swami Vivekananda
raji33
Premium Member
Premium Member
Posts: 151
Joined: Thu Sep 23, 2010 9:21 pm
Location: NJ

Post 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' ','
raji33
Premium Member
Premium Member
Posts: 151
Joined: Thu Sep 23, 2010 9:21 pm
Location: NJ

Post 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' ','
nitkuar
Participant
Posts: 46
Joined: Mon Jun 23, 2008 3:09 am

Post 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.
anbu
Premium Member
Premium Member
Posts: 596
Joined: Sat Feb 18, 2006 2:25 am
Location: india

Post 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?
You are the creator of your destiny - Swami Vivekananda
raji33
Premium Member
Premium Member
Posts: 151
Joined: Thu Sep 23, 2010 9:21 pm
Location: NJ

Post 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
raji33
Premium Member
Premium Member
Posts: 151
Joined: Thu Sep 23, 2010 9:21 pm
Location: NJ

Post by raji33 »

yes anbu that what exactly i want then in transformaer i will use field function and pick the 2nd field
nitkuar
Participant
Posts: 46
Joined: Mon Jun 23, 2008 3:09 am

Post 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.
raji33
Premium Member
Premium Member
Posts: 151
Joined: Thu Sep 23, 2010 9:21 pm
Location: NJ

Post 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
Post Reply