Expressing delimiter's in a loop stage??

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
dh_Madhu
Premium Member
Premium Member
Posts: 65
Joined: Sat Apr 23, 2005 3:19 am
Location: Stirling, Scotland

Expressing delimiter's in a loop stage??

Post by dh_Madhu »

Hi,
In a loop stage I use the list loop option for which I get values by issuing a ls -m command which retrieves a list of files with a comma and SPACE between each file. It also has a New Line character added to it at the end of the fourth file in the list.
File1, File2, File3, File4,
File5, File6, File7, File8

Now how do i specify two different delimiters at the same time for those files which fall at the end??
This has taken a lot of time out of me.
Could I get your valuable inputs pls.
Thanks.
Regards,
Madhu Dharmapuri
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Technically there's only one delimiter - the comma.

Why do "ls -m" and complicate things? Why not use "ls -1" instead?
-craig

"You can never have too many knives" -- Logan Nine Fingers
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Note that the argument to ls here is the numeric "1", not the lower case "L". The "1" option forces output to be one file per line, that is, in a single column. It's the easiest way to get a list of file names to process. You can follow it with any regular expression for filtering the list of file names.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
dh_Madhu
Premium Member
Premium Member
Posts: 65
Joined: Sat Apr 23, 2005 3:19 am
Location: Stirling, Scotland

Post by dh_Madhu »

Chulett & Ray,
Yes!
I did try ls -1 and got an output like
File1
File2
File3
File4
.......that was fine but the delimiter '\n' is not being recognised. Is the representation of this carriage return right or is there any other way.
If this works out then that would be excellent.
Thanks.
Regards,
Madhu Dharmapuri
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Line terminators are converted to field marks (@FM) when captured.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
dh_Madhu
Premium Member
Premium Member
Posts: 65
Joined: Sat Apr 23, 2005 3:19 am
Location: Stirling, Scotland

Post by dh_Madhu »

I got it.
Thanks a lot Ray.
Regards,
Madhu Dharmapuri
Post Reply