![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Rules & FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| UNIX for Advanced & Expert Users Advanced UNIX and Linux questions go here. Expert-to-Expert. |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| reading from a file and pass as variables and ignore # in the file | konark | Shell Programming and Scripting | 4 | 11-07-2007 11:55 PM |
| Script for reading filelist and preparing param file. | thebeginer | UNIX for Dummies Questions & Answers | 2 | 10-05-2007 01:19 PM |
| Reading and Writing file on LAN | lucky001 | High Level Programming | 3 | 03-30-2007 11:16 AM |
| Reading file names from a file and executing the relative file from shell script | anushilrai | Shell Programming and Scripting | 4 | 03-10-2006 01:25 AM |
| Reading specific contents from a file and appending it to another file | dnicky | Shell Programming and Scripting | 5 | 10-04-2005 02:45 AM |
|
|
LinkBack | Thread Tools | Display Modes |
|
|||
|
Reading a file and writing the file name to a param file.
Hi All,
Not sure if this would be in a dummies sectiin or advanced. I'm looking for a script if someone has doen something like this. I have list of files - adc_earnedpoints.20070630.txt adc_earnedpoints.20070707.txt adc_earnedpoints.20070714.txt adc_earnedpoints.20070721.txt adc_earnedpoints.20070728.txt adc_earnedpoints.20070804.txt adc_earnedpoints.20070811.txt adc_earnedpoints.20070818.txt I need to process these files using informatica process and write the content of the file to a DB table. While writing the file to db i need to capture the date from the file name and pass to a parameter file in unix and use the parameter file to write the data value in db. And also i need to process 1 file for each run so that i can grab teh date from teh file name and capture in a param file which will be used by Informatica process. Something like this - file processing adc_earnedpoints.20070630.txt should be renamed to generic file adc_earnedpoints.txt and the date 20070630 should be wrriten to a param file with values - s_load_earned_points (informatica session) $$process_date=20070630 (which will be called in teh informatica mapping. And similarly process teh rest of files. Has anyone ever done something like this before, if so could you please provide teh script for this. Any help is greatly & kindly appreciated. Regards, Beginer. |
| Forum Sponsor | ||
|
|
|
|||
|
not sure what exactly are you looking for..if i understood correctly..u may want to do something like this-
for file in adc_earnedpoints*.txt do datestr=`echo $file | cut -d. -f2` new=`echo $file | cut -d. -f1,3` mv $file $new #call informatica session with the datestr done cheers, Devaraj Takhellambam |
|||
| Google UNIX.COM |