![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| UNIX for Advanced & Expert Users Expert-to-Expert. Learn advanced UNIX, UNIX commands, Linux, Operating Systems, System Administration, Programming, Shell, Shell Scripts, Solaris, Linux, HP-UX, AIX, OS X, BSD. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| 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-08-2007 03:55 AM |
| Script for reading filelist and preparing param file. | thebeginer | UNIX for Dummies Questions & Answers | 2 | 10-05-2007 04:19 PM |
| Reading and Writing file on LAN | lucky001 | High Level Programming | 3 | 03-30-2007 02:16 PM |
| Reading file names from a file and executing the relative file from shell script | anushilrai | Shell Programming and Scripting | 4 | 03-10-2006 05:25 AM |
| Reading specific contents from a file and appending it to another file | dnicky | Shell Programming and Scripting | 5 | 10-04-2005 05:45 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | 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. |
|
||||
|
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 |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|