![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| UNIX and Linux Applications Discuss UNIX and Linux software applications. This includes SQL, Databases, Middleware, MOM, SOA, EDA, CEP, BI, BPM and similar topics. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| how to write pseudo code | hanaveenkumar | Shell Programming and Scripting | 1 | 05-14-2009 03:17 AM |
| How to write a code in C to search a file | krishna_sicsr | High Level Programming | 6 | 08-04-2008 07:07 PM |
| AWK deifnition and some small code explanation | amatuer_lee_3 | Shell Programming and Scripting | 0 | 05-17-2008 10:57 PM |
| small script - get sql output & write into txt | happyv | Shell Programming and Scripting | 2 | 02-02-2007 11:55 AM |
| need help to write perl code | getdpg | Shell Programming and Scripting | 0 | 09-20-2006 10:24 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
Need small help to write the code in unix
Hi all,
I get data-files which has a particular identified on the 1st record( header ), based on which I've to load a constant for the 1st column of every row. How do I set in the control file using unix shell script. Appreciate if someone can give me some directions on this. Thanks in advance |
|
||||
|
Need small help to write the code in unix
Hi,
I tried with the shell script but it is not loading into table for the below script #!/bin/bash #export custno="" custno=$(awk -F"," '{print NR " " $3}' 'datafile.txt' | grep 1 | cut -d" " -f2) sed 's/#x#/'$custno'/g' 'ctrl.ctl' Below is the data file(datafile.txt) sno,sNAME,35642,reactflag 1,KIRAN,KUMAR 2,SURESH,KUMAR 3,MADHU,VARIGONDA Here is the control file(ctrl.ctl) options(skip =1) LOAD DATA INFILE 'datafile.txt' TRUNCATE INTO TABLE LOADER_TEST FIELDS TERMINATED BY ',' TRAILING NULLCOLS ( sno Integer external, sname char(50), custno char(50) CONSTANT '#x#', reactflag char(50) ) Please help me in advance |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|