Sponsored Content
Top Forums Shell Programming and Scripting Reading colums from a text file Post 302895440 by spacebar on Monday 31st of March 2014 09:52:02 PM
Old 03-31-2014
You could do something like this to read the fields into a variable:
Code:
while read studentname grade class teacher
do
  echo "${teacher} ${class} ${grade} ${studentname}" >> /path/to/your/new_file
done </path/to/your/file

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

reading text file

I have a text file with 50 munbers. I wanna read these numbers and append "@yahoo.com" and send emails to them using shell scripting.......... How do i read the inetegres from the text file. (1 Reply)
Discussion started by: jaan
1 Replies

2. Shell Programming and Scripting

[Shell] How make colums in text file ??

hi, i have little pb, i would like make a colums, but my server not recongize "\t" or i write wrong.... and iam little noobs and no know awk... #!/bin/ksh #---------------------------------------------------------------------------- # Fichiers : ctrl.sh et ctrl2005.txt ... (6 Replies)
Discussion started by: parola
6 Replies

3. Shell Programming and Scripting

Reading text from a file

Guys, I am trying to read text from a file, into arrays. The format of the file is: @DATABASE femotest @PACKAGE_SPECS /usr/home/oracle92/sosa/scripts/test.pks /usr/home/oracle92/sosa/scripts/rep.pks @PACKAGE_BODIES ... (12 Replies)
Discussion started by: LiquidChild
12 Replies

4. Shell Programming and Scripting

Reading from Text file.....

Hi Im MZ.... please help me with my requirements..... Requirement: I have a text file named information.txt which contains information about Oracle Instances, I want to fetch data's from that text file and want to display an output using shell script. Explanation : i.e. when I execute that... (0 Replies)
Discussion started by: user__user3110
0 Replies

5. UNIX for Dummies Questions & Answers

Help with reading text file

How can i have a while loop as follows while read inputline do <task> done < name_list and also store the values (delimited) on each line to temp variables so as to print them on screen as follows while read inputline do set name | cut -d "," -f1 name_list # #i know this is not... (1 Reply)
Discussion started by: bilal05
1 Replies

6. Shell Programming and Scripting

Help with Reading Text from file

Hello, I am having a tough time reading data from an input text file. The input file has lines of data which is comma seperated. Each line represents a record/row, but unfortunately the data in the individual column/fields have spaces and `cat filename`is not returning entire line ( to read... (4 Replies)
Discussion started by: yajaykumar
4 Replies

7. Programming

reading a text file in c++

hello all , im trying to read a text file and display its contents. While i got the code running and the output was displayed perfectly for sometime , i started getting Abort(core dump) error . Am i missing something here ? im using HP-UX. #include <iostream.h> #include <fstream.h> #include... (1 Reply)
Discussion started by: vishy_85
1 Replies

8. Shell Programming and Scripting

Reading a value from another text file

I am having a text file best = 100 genre = 75 group = 53 . . and so on I need to read those values (100,75,53,...) from my shell script. I have to do the same function for all the variables. So in my script i used for loop to do the same. for { a=best b=100 } Video tutorial on... (3 Replies)
Discussion started by: kishorekumar87
3 Replies

9. UNIX for Dummies Questions & Answers

Reading Xml file and print the values into the text file in columnwise?

hi guys, i want help... Reding XML file and print the values into the text file using linux shell script file as per below xml file <sequence> <Filename>aldorzum.doc</Filename> <DivisionCode>US</DivisionCode> <ContentType>Template</ContentType> <ProductCode>VIMZIM</ProductCode> </sequence>... (4 Replies)
Discussion started by: sravanreddy
4 Replies

10. Programming

How to write in other language in text/xml file by reading english text/xml file using C++?

Hello Team, I have 2 files.one contains english text and another contains Japanese. so i have to read english text and replace the text with Japanesh text in third file. Basically, I need a help to write japanese language in text/xml file.I heard wstring does this.Not sure how do i write... (2 Replies)
Discussion started by: SA_Palani
2 Replies
uucp(1) 						      General Commands Manual							   uucp(1)

NAME
uucp - Unix to Unix copy SYNOPSIS
uucp [ options ] source-file destination-file uucp [ options ] source-file... destination-directory DESCRIPTION
The uucp command copies files between systems. Each file argument is either a pathname on the local machine or is of the form system!path which is interpreted as being on a remote system. In the first form, the contents of the first file are copied to the second. In the sec- ond form, each source file is copied into the destination directory. A file be transferred to or from system2 via system1 by using system1!system2!path. Any pathname that does not begin with / or ~ will be appended to the current directory (unless the -W or --noexpand option is used); this resulting path will not necessarily exist on a remote system. A pathname beginning with a simple ~ starts at the UUCP public directory; a pathname beginning with ~name starts at the home directory of the named user. The ~ is interpreted on the appropriate system. Note that some shells will interpret a simple ~ to the local home directory before uucp sees it; to avoid this the ~ must be quoted. Shell metacharacters ? * [ ] are interpreted on the appropriate system, assuming they are quoted to prevent the shell from interpreting them first. The copy does not take place immediately, but is queued up for the uucico (8) daemon; the daemon is started immediately unless the -r or --nouucico switch is given. In any case, the next time the remote system is called the file(s) will be copied. OPTIONS
The following options may be given to uucp. -c, --nocopy Do not copy local source files to the spool directory. If they are removed before being processed by the uucico (8) daemon, the copy will fail. The files must be readable by the uucico (8) daemon, and by the invoking user. -C, --copy Copy local source files to the spool directory. This is the default. -d, --directories Create all necessary directories when doing the copy. This is the default. -f, --nodirectories If any necessary directories do not exist for the destination path, abort the copy. -R, --recursive If any of the source file names are directories, copy their contents recursively to the destination (which must itself be a direc- tory). -g grade, --grade grade Set the grade of the file transfer command. Jobs of a higher grade are executed first. Grades run 0 ... 9 A ... Z a ... z from high to low. -m, --mail Report completion or failure of the file transfer by mail (1). -n user, --notify user Report completion or failure of the file transfer by mail (1) to the named user on the remote system. -r, --nouucico Do not start uucico (8) daemon immediately; merely queue up the file transfer for later execution. -j, --jobid Print jobid on standard output. The job may be later cancelled by passing the jobid to the -k switch of uustat (1). It is possible for some complex operations to produce more than one jobid, in which case each will be printed on a separate line. For example uucp sys1!~user1/file1 sys2!~user2/file2 ~user3 will generate two separate jobs, one for the system sys1 and one for the system sys2. -W, --noexpand Do not prepend remote relative path names with the current directory. -t, --uuto This option is used by the uuto shell script. It causes uucp to interpret the final argument as system!user. The file(s) are sent to ~/receive/USER/LOCAL on the remote system, where USER is from the final argument and LOCAL is the local UUCP system name. Also, uucp will act as though --notify user were specified. -x type, --debug type Turn on particular debugging types. The following types are recognized: abnormal, chat, handshake, uucp-proto, proto, port, config, spooldir, execute, incoming, outgoing. Only abnormal, config, spooldir and execute are meaningful for uucp. Multiple types may be given, separated by commas, and the --debug option may appear multiple times. A number may also be given, which will turn on that many types from the foregoing list; for example, --debug 2 is equivalent to --debug abnormal,chat. -I file, --config file Set configuration file to use. This option may not be available, depending upon how uucp was compiled. -v, --version Report version information and exit. --help Print a help message and exit. SEE ALSO
mail(1), uux(1), uustat(1), uucico(8) BUGS
Some of the options are dependent on the capabilities of the uucico (8) daemon on the remote system. The -n and -m switches do not work when transferring a file from one remote system to another. File modes are not preserved, except for the execute bit. The resulting file is owned by the uucp user. AUTHOR
Ian Lance Taylor <ian@airs.com> Taylor UUCP 1.07 uucp(1)
All times are GMT -4. The time now is 07:37 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy