The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
make multiple line containing a pattern into single line VTAWKVT Shell Programming and Scripting 13 12-04-2008 06:40 PM
how to delete text from line starting pattern1 up to line before pattern2? repudi8or Shell Programming and Scripting 5 04-15-2008 09:25 PM
Unix Script with line number at beginning of each line. mascorro Shell Programming and Scripting 5 06-19-2006 04:34 PM
identifying duplicates line & reporting their line number stresslog UNIX for Dummies Questions & Answers 5 04-24-2006 12:43 AM
Remove header(first line) and trailer(last line) in ANY given file madhunk Shell Programming and Scripting 2 03-13-2006 03:36 PM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 08-08-2006
u263066 u263066 is offline
Registered User
  
 

Join Date: Jul 2006
Posts: 66
skiping last line

I have situation

I have to load the datefile through a loader program, and that why I have one loader control file.
My datafile is having first line and last line and inbetween all the data which i need to load into oracle through Sql*loader.

I did not requires last line of data to be loaded into oracle , infact for first line I am able to skip through there inbuilt commond "SKIP =1"

I have tried couple of other options but seems Sql*loader does have limitation and cann't helps in skipping the last line.

alternatively, I am thinking to execute a shell script that remove the last line and put the file as it is with out changing the name and rest of data.

can any one tell me what is adject unix common which I need to fire before executing sql*loader.

I am enclosing my structure of data file:
Code:
03Feb02,14Feb02,A
2039380,AT7000,GB1200,NZD,123456789.00-,07Mar02,INVOICE REFERNCE VVVVVVV,10Feb02,,,EUR,57307148.03-,0.4641879,01,2
2039382,AT1234,GB5000,GBP,674.13-,17Mar02,INVOICE REFERNCE,02Feb02,,,EUR,1077.40-,1.5982100,01,2
................
....
039379,SG1111,GB5000,USD,1423456.00-,07Mar02,INVOICE REFERNCE MMMMMMM,11Feb02,,,SGD,2599168.60-,1.8259564,01,2
2039381,VN5100,GB5000,EUR,741852.00-,07Mar02,INVOICE REFERNCE ZXCVBN,08Feb02,,,SGD,1218046.80-,1.6419000,01,2
END
last line always identified by END.
  #2 (permalink)  
Old 08-08-2006
Dhruva's Avatar
Dhruva Dhruva is offline
Registered User
  
 

Join Date: Mar 2006
Location: India
Posts: 255
following two lines will do the jo

Code:
sed -n '$!p' filename>temp
mv temp filename
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 07:00 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0