Inserting shell script input data automatically from a text file
Dear experts,
I am new to linux programming. I have a shell script which i should run it on all my samples.
I only define input and out put for this script. The inputs are 3 numbers(coordination numbers) which are available in a series of text file.
Since i have a lots of samples, it takes a lot of time to manually insert the numbers to the script.
Is it possible to write a script which automatically insert the numbers from the text files to the script?
An example of my text filein this example only 49 75 48 are used as inputs, so i need to extract them automatically from the text file and insert them as inputs to the script)
I will be grateful for any help you can provide.
Best,
Mohamad
Last edited by Scrutinizer; 01-23-2016 at 04:18 PM..
Reason: CODE tags
Thanks for your prompt answer,i really really appreciate it.
Sorry, if I ask, but I don't know how to read the text file and also i don't know how to give the outputs to my script.
First i should copy your script to a text file, next i should make it executable and finally i should set the path,right?
i only need the first row parameters, does this scripts only echo values of max_x max_y and max_z in the first row?
my script is:
(Inputimage and max_x, max_y and max_z are the inputs)
Since i am new to Linux programming, i will be grateful for your help with this situation
Best,
Mohamad
Last edited by Scrutinizer; 01-23-2016 at 09:04 PM..
Reason: code tags
i have written my shell script in notepad however i am struggling to pass the data file to be read to the script the data file is of .txt format. My target is to run the shell script from the terminal and pass 3 arguments e.g. polg@DESKTOP-BVPDC5C:~/CS1420/coursework$ bash valsplit.sh input.txt... (11 Replies)
Hi,
Please help me on this.
I want to insert data from text file to excel using shell script
nawk -v r=4 -v c=4 -v val=$a -F, 'BEGIN{OFS=","}; NR != r; NR == r {$c = val; print}' "file.csv"
I used above one to insert $a value in 4th row, 4th column in an excel file.csv and it... (3 Replies)
The scope of the shell/perl script is to read the input text file. Validate the expiry date of each certificate and send the mail to the user. The user takes action to add the new certificate to the storage file and user owns the responsibility to update the input text file with the new certificate... (5 Replies)
HI all,
I want to script where all the server names will be in a text file like
server1
server2
server3 . and the script should take servernames from a text file and perform copy of files if the files are not present on those servers.after which it should take next servername till the end of... (0 Replies)
I am having one text file and i need to read that data from my shell script.
I will expain you the scenario:
Script look like:
For name type 1:
For age type 2:
For Salary type3:
echo "Enter the input:"
read the data
if input is 1 then go to the Text file and print the... (2 Replies)
Hi,
I have data in my text file something like this.
adams
robert
ahmed
gibbs
I want to use this data line by line as input to an sql query which i run by connecting to an oracle database from shell.
If you have code for similar scenario , please ehlp.
I want the output of the sql query... (7 Replies)
Hello, I have got the script below that reads a text file and then extract data from the third column and then send the result to another shell scrpt call tsim - the script works fine.
The problem I am having is that I want the user to enter the 'Test Day' which the first column in the text file,... (1 Reply)
I'm trying to clean up my server and I have the list of some "special" users stored on the text file like this
Now I want to write a shell script to finger all of them so I can have some kind of ideas who they are but here comes the problem....I completely forgot how to do it with shell... (3 Replies)