Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Inserting shell script input data automatically from a text file Post 302965092 by Scrutinizer on Saturday 23rd of January 2016 03:29:35 PM
Old 01-23-2016
Try:
Code:
TAB=$(printf "\t")
while IFS=$TAB read ci voxels max max_x max_y max_z cog_x cog_y cog_z
do
  echo "$max_x, $max_y, $max_z"
done < infile


If you only need those the three values you could simplify like this :
Code:
TAB=$(printf "\t")
while IFS=$TAB read x x x max_x max_y max_z x
do
  echo "$max_x, $max_y, $max_z"
done < infile

where "x" contains dummy values..


--
In bash ksh93 and zsh you can use:
Code:
while IFS=$'\t' read ...

in other shells you can use a hard-TAB (entered through CTRL-V TAB)
This User Gave Thanks to Scrutinizer For This Post:
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How to input username on text file into finger command on shell script

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)
Discussion started by: Micz
3 Replies

2. Shell Programming and Scripting

Using Shell Script to get data from text file

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)
Discussion started by: jermaine4ever
1 Replies

3. Shell Programming and Scripting

how to use data in unix text file as input to an sql query from shell

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)
Discussion started by: rdhanek
7 Replies

4. Shell Programming and Scripting

How to read the data from the text file in shell script?

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)
Discussion started by: dineshmurs
2 Replies

5. Shell Programming and Scripting

shell script to take input from a text file and perform check on each servers and copy files

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)
Discussion started by: joseph.dmello
0 Replies

6. Shell Programming and Scripting

The scope of the shell/perl script is to read the input text file. Validate the expiry date of each

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)
Discussion started by: casmo
5 Replies

7. Shell Programming and Scripting

Need help on inserting data from text file to excel using shell script

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)
Discussion started by: suman.frnz
3 Replies

8. UNIX for Dummies Questions & Answers

Shell script to read lines in a text file and filter user data Shell Programming and Scripting

sxsaaas (3 Replies)
Discussion started by: VikrantD
3 Replies

9. Shell Programming and Scripting

How to get the shell script to read the .txt file as an input/data?

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)
Discussion started by: Gurdza32
11 Replies

10. UNIX for Beginners Questions & Answers

Need list of input and output parameter of task in a text file, using shell script

//file begin ===== //some code task abcd_; input x; input y,z; //some comment output w; //some comment reg p; integer q; begin //some code end endtask : abcd_ //some code //file end ===== expected output from above... (1 Reply)
Discussion started by: rishifrnds
1 Replies
Gtk2::Curve(3)						User Contributed Perl Documentation					    Gtk2::Curve(3)

NAME
Gtk2::Curve HIERARCHY
Glib::Object +----Glib::InitiallyUnowned +----Gtk2::Object +----Gtk2::Widget +----Gtk2::DrawingArea +----Gtk2::Curve INTERFACES
Glib::Object::_Unregistered::AtkImplementorIface Gtk2::Buildable METHODS
widget = Gtk2::Curve->new $curve->set_curve_type ($type) o $type (Gtk2::CurveType) $curve->set_gamma ($gamma) o $gamma (double) $curve->set_range ($min_x, $max_x, $min_y, $max_y) o $min_x (double) o $max_x (double) o $min_y (double) o $max_y (double) $curve->reset list = $curve->get_vector ($veclen=32) o $veclen (integer) Returns a list of real numbers, the curve's vector. $curve->set_vector (...) o ... (list) of float's, the points of the curve PROPERTIES
'curve-type' (Gtk2::CurveType : readable / writable / private) Is this curve linear, spline interpolated, or free-form 'max-x' (Glib::Float : readable / writable / private) Maximum possible X value 'max-y' (Glib::Float : readable / writable / private) Maximum possible value for Y 'min-x' (Glib::Float : readable / writable / private) Minimum possible value for X 'min-y' (Glib::Float : readable / writable / private) Minimum possible value for Y SIGNALS
curve-type-changed (Gtk2::Curve) ENUMS AND FLAGS
enum Gtk2::CurveType o 'linear' / 'GTK_CURVE_TYPE_LINEAR' o 'spline' / 'GTK_CURVE_TYPE_SPLINE' o 'free' / 'GTK_CURVE_TYPE_FREE' SEE ALSO
Gtk2, Glib::Object, Glib::InitiallyUnowned, Gtk2::Object, Gtk2::Widget, Gtk2::DrawingArea COPYRIGHT
Copyright (C) 2003-2008 by the gtk2-perl team. This software is licensed under the LGPL. See Gtk2 for a full notice. perl v5.12.1 2010-07-05 Gtk2::Curve(3)
All times are GMT -4. The time now is 06:18 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy