shell script for changing the input file as output file

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
dodda
Premium Member
Premium Member
Posts: 244
Joined: Tue May 29, 2007 11:31 am

shell script for changing the input file as output file

Post by dodda »

Hi all,
I had a small requirement in shell script.

In the Input directory iam having input file as RATE3092008033101.csv

I have to change the above file as PRICE3092008033101.csv and save the file in another directory.

RATE should be replaced by PRICE. And the input file names are not fixed , any new files may come in future.
Only RATE string is fixed, i have to replace with string PRICE.

please help me out in solving this one.

Thanks in advance.
Ultramundane
Participant
Posts: 407
Joined: Mon Jun 27, 2005 8:54 am
Location: Walker, Michigan
Contact:

Re: shell script for changing the input file as output file

Post by Ultramundane »

dodda wrote:Hi all,
I had a small requirement in shell script.

In the Input directory iam having input file as RATE3092008033101.csv

I have to change the above file as PRICE3092008033101.csv and save the file in another directory.

RATE should be replaced by PRICE. And the input file names are not fixed , any new files may come in future.
Only RATE string is fixed, i have to replace with string PRICE.

please help me out in solving this one.

Thanks in advance.
cp RATE3092008033101.csv $(echo /dirname/RATE3092008033101.csv | sed 's/RATE/PRICE/g')
Post Reply