importing variables from 1 file to another


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting importing variables from 1 file to another
# 1  
Old 09-28-2012
importing variables from 1 file to another

hi
i want to retrieve talespace, datafile's path , size and another size in following querry in shell



Create Tablespace 'A' Datafile 'Some
Path' Size '10G' extent management Local uniform size '64M';

from another file say 'A.txt' where i ll dumb data in sequence separated by commas (,) ...
can u plz suggest me some code to do the same A.txt will b like (b,somepath,size1,size2)...

tnx
# 2  
Old 09-28-2012
Code:
#!/usr/bin/perl -w

while(<>){print"$1,$2,$3,$4\n"if/^.+?'(.+?)'.+?'(.+?)'.+?'(.+?)'.+?'(.+?)';$/}

usage: ./script a.txt
tip78
# 3  
Old 09-28-2012
Code:
IFS=,; while read TBL DATF SIZ USIZ
 do printf "Create Tablespace \'%s\' Datafile \'%s\' Size \'%s\' extent management Local uniform size \'%s\'\n" \
$TBL $DATF $SIZ $USIZ
done < file


Last edited by RudiC; 10-04-2012 at 04:22 AM..
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. AIX

Issue while importing Oracle Dump File on AIX 5.3

Hi All, I am facing one problem related to importing Oracle Dump file. We have two different version of AIX boxes with oracle (version 10.2.0.4.0) installed. On one AIX box (version 6.1) we are creating oracle dump file (*.dmp) using oracle exp utility and importing it onto another AIX box... (1 Reply)
Discussion started by: gunjan_thakur
1 Replies

2. Windows & DOS: Issues & Discussions

Help importing SQL DB using phpmyadmin

Hi, When I try to import the database, getting error message. No data was received to import. Either no file name was submitted or the file size exceeded the maximum size permitted by your PHP configuration. I am doing this on Windows server, I updated php.ini file and stop and... (2 Replies)
Discussion started by: samnyc
2 Replies

3. Shell Programming and Scripting

Importing File fields into a script

Hi All, Kindly tell me how to import a file fields in a scripts scripts=adder.sh >> add values vi adder.sh (for example) N1=$1 N2=$2 N=$N1+$N2 *********** file.txt 2|1 3|4 5|6 (3 Replies)
Discussion started by: teefa
3 Replies

4. UNIX for Dummies Questions & Answers

importing a Physical Volume

hi guys I'm added a new disk to my server (virtual environment) It used to be a Volume Group=Vol_Group01 and Logical Volume= Log_Vol_01_Data and I see /dev/sdb Disk /dev/sdb doesn't contain a valid partition table Disk /dev/sdc: 133.1 GB, 133143986176 bytes 255 heads, 63... (3 Replies)
Discussion started by: karlochacon
3 Replies

5. Shell Programming and Scripting

Importing a path/file into a bash script

Hey, I'm new here. Basically, I'm trying to make a bash script that affects a file of my choice. What I want to do is $./script.sh /path/to/file.jpg and then the bash script will know that variable=/path/to/file.jpg Thanks! (4 Replies)
Discussion started by: TFB
4 Replies

6. Shell Programming and Scripting

Importing Autosys Calendar.

Hi All, I'm try to import a Calendar in Autosys using below command, autocal_asc -I TKY_Test Utility to Add/Delete or Print entries in Calendar. Calendar Name: But it not allowing me to import the calendar, it asks for the calendar which is similair if we try to manually add calender... (1 Reply)
Discussion started by: arvindcgi
1 Replies

7. Programming

importing xml: problem

I'm an absolute newbie for unix... For my work, I have to import a xml file in our system (jsp+sql) via putty telnet. Once i have copied the file in the right directory, I launch this command: ./thisImport -i input/thisImport/newimport.20071130.xml -l 10 -t this is a test (as you can see),... (1 Reply)
Discussion started by: tranky
1 Replies

8. UNIX for Advanced & Expert Users

Importing PGP keys

I'm hoping someone can help get me moving in the right direction here, so bear with me. I've got 2 RedHat Linux servers, let's call them A & B. - A receives "sensitive" files, which are PGP encrypted, and immediately sends them off to B for decryption/processing/deletion - B needs to make... (1 Reply)
Discussion started by: peteroc
1 Replies

9. Shell Programming and Scripting

Importing dump file

Hi, I am trying to import 22 .dmp files but facing the problem with the last table file it never ends the import command, only the table is created but the rows of the table don't get imported. This is the problem with only ine table rest 21 tables are being imported properly. Thanks in... (2 Replies)
Discussion started by: anushilrai
2 Replies

10. UNIX for Dummies Questions & Answers

Importing a unix file dump into a PC capable database

My development team has been trying to figure out how to import a unix data dump into SQL Server or convert it into an intermediate file format for several days. The data dump in question looks like this: $RecordID: 1<eof> $Version: 1<eof> Category: 1<eof> Poster: John Doe<eof>... (7 Replies)
Discussion started by: DaltonF
7 Replies
Login or Register to Ask a Question