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
Calling a perl script from a perl script new2ss Shell Programming and Scripting 6 05-24-2009 05:03 PM
Include PERL script with in the unix shell script ganapati UNIX for Dummies Questions & Answers 1 04-29-2008 12:18 PM
here document to automate perl script that call script hogger84 Shell Programming and Scripting 3 10-22-2007 10:15 AM
Modify Perl script to work with txt - Permissions script joangopan Shell Programming and Scripting 1 09-12-2007 11:38 PM
Perl: Run perl script in the current process vino Shell Programming and Scripting 10 12-09-2005 10:45 AM

 
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
Prev Previous Post   Next Post Next
  #1 (permalink)  
Old 06-04-2008
sabyasm sabyasm is offline
Registered User
  
 

Join Date: Sep 2005
Posts: 27
Post Perl/Sed script help

Hi All,

I would need to generate Oracle Inster scripts from an excel formatted spreadsheet as follows:

Quote:
SRVC_ROLE_SPECIFICATION
REC 1
SRVC_ROLE_SPEC_ID : 1
SRVC_ROLE_TYPE : heAdmin
MIN_NUMBER_ALLOWED : 1
MAX_NUMBER_ALLOWED : 1
IDENTIFIER_NAME_SPACE : NULL
CREDENTIAL_TYPE : ENCRYPTEDTEXT
SRVC_SPECIFICATION_ID : 1
REC 2
SRVC_ROLE_SPEC_ID : 2
SRVC_ROLE_TYPE : emailLite
MIN_NUMBER_ALLOWED : 1
MAX_NUMBER_ALLOWED : 10
IDENTIFIER_NAME_SPACE :
CREDENTIAL_TYPE : ENCRYPTEDTEXT
SRVC_SPECIFICATION_ID : 1
REC 3
SRVC_ROLE_SPEC_ID : 3
SRVC_ROLE_TYPE : hostopiaAdmin
MIN_NUMBER_ALLOWED : 1
MAX_NUMBER_ALLOWED : 1
IDENTIFIER_NAME_SPACE :
CREDENTIAL_TYPE : ENCRYPTEDTEXT
SRVC_SPECIFICATION_ID : 2
REC 4
SRVC_ROLE_SPEC_ID : 4
SRVC_ROLE_TYPE : voicemailAdmin
MIN_NUMBER_ALLOWED : 1
MAX_NUMBER_ALLOWED : 1
IDENTIFIER_NAME_SPACE : ?
CREDENTIAL_TYPE : ENCRYPTEDTEXT
SRVC_SPECIFICATION_ID : 2
REC 5
SRVC_ROLE_SPEC_ID : 5
SRVC_ROLE_TYPE : voicemailUser
MIN_NUMBER_ALLOWED : 1
MAX_NUMBER_ALLOWED : NULL (this indicates no upper limit)
IDENTIFIER_NAME_SPACE :
CREDENTIAL_TYPE : ENCRYPTEDTEXT
SRVC_SPECIFICATION_ID : 2
This needs to be stripped as follows:

Quote:
REC 1 : INSERT INTO SRVC_ROLE_SPECIFICATION (SRVC_ROLE_SPEC_ID, SRVC_ROLE_TYPE, MIN_NUMBER_ALLOWED, MIN_NUMBER_ALLOWED , MAX_NUMBER_ALLOWED, IDENTIFIER_NAME_SPACE , CREDENTIAL_TYPE, SRVC_SPECIFICATION_ID)
VALUES
(1,'heAdmin',1,1,'NULL','ENCRYPTEDTEXT',1);

REC 2 : ..

REC 1, REC 2 etc are the separators of the records ...

I beleive a pearl script can be written for this ... anything useful will be of great help.

Thanks in Advance
Sabya
 

Bookmarks

Tags
solaris

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 09:20 AM.


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