Importing File fields into a script


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Importing File fields into a script
# 1  
Old 06-20-2013
Importing File fields into a script

Hi All,

Kindly tell me how to import a file fields in a scripts

Code:
 
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|5
 
************
i want output to be :  ./adder.sh file.txt 
 
gives me output  : 
 
3
7
11
8

plz send me ASAP
# 2  
Old 06-20-2013
Is this a homework assignment? This isn't the type of problem we usually see in this forum.
# 3  
Old 06-20-2013
Quote:
Originally Posted by Don Cragun
Is this a homework assignment? This isn't the type of problem we usually see in this forum.
hahahha not its not but sorry i cant imagine now how to do it
so kindly its urgent if you can help me send me how to do it
# 4  
Old 06-20-2013
This is not an appropriate forum for threads that need an urgent response or a response ASAP.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

Script to parse and compare information in two fields of file

Hello, I am working parsing a large input file1(field CFA) I have to compare the the file1 field(CFA byte 88-96) with the content of the file2(It contains only one field) and and insert rows equal in another file. Here is my code and sample input file: ... (7 Replies)
Discussion started by: GERMANOS
7 Replies

2. 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

3. Shell Programming and Scripting

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... (2 Replies)
Discussion started by: Gl@)!aTor
2 Replies

4. UNIX for Dummies Questions & Answers

Data Importing using shell script

Hi All, I have a .csv file pipe delimter.., I am using excel data import option for importing the data from a pipe delimter file to xls...I want to make this happen using shell script. Please let me know how can I do this using shell script. Regards, Deepti (2 Replies)
Discussion started by: gaur.deepti
2 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 functions from an external bash script

Hi all, I'm trying to import some functions I have saved in a file named functions.sh into a different script (protocol.sh). Can anybody show me how to do this? I tried source functions.sh as I would do at the terminal but source command cannot be found from within the script protocol.sh. ... (2 Replies)
Discussion started by: tevang
2 Replies

7. Shell Programming and Scripting

awk script to (un)/concatenate fields in file

Hi everyone, I'm trying to use the "join" function for more than 1 field. Since it's not possible as it is, I want to take my input files and concatenate the joining fields as 1 field (separated by "|"). I wrote 2 awk script to do and undo it (see below). However I'm new to awk and I'm certain I... (5 Replies)
Discussion started by: anthony.cros
5 Replies

8. Shell Programming and Scripting

Shell script for validating fields in a file

Hi, I have not used Unix in a very long time and I am very rusty. I would appreciate any help I can get from the more experienced and experts in Shell script. I am reading one file at a time from a folder. The file is a flat file with no delimeters or carriage return. Col1 through col6 is... (5 Replies)
Discussion started by: asemota
5 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