Reading from Text file.....


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Reading from Text file.....
# 1  
Old 04-11-2008
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 shell script ,it should read all data's from information.txt and display an output like below.
I willl try explain with an example...
Say i have a file "file" containing..
Instance : DB1,windows
Instance : DB2,unix
Instance : DB3,solaris
Instance : DB4,unix
;;;;;;;;etc

so... my shell script should read the file and display output as

DB1,windows,OK
DB2,unix,OK
DB3,solaris,OK
DB4,unix, OK
;;;;; etc
How do I write this script? Can you tell me ..which command wud be apporiate.?

Thanks
MZ
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

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

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

3. Shell Programming and Scripting

Reading colums from a text file

Hi all, I have a text file that has (4) columns. There are about 300 lines on this file. It is a plain text file. I am looking to write a simple script that will read each line from the file and generate another text file. The file looks something like this: These are the columns: ... (4 Replies)
Discussion started by: adamw
4 Replies

4. Shell Programming and Scripting

Reading the text file for particular format

Hi All, Need your help!! I have particular host file with below format: 172.34.45.67 Host1 Host2 134.45.56.67 Host3 Host4 Host5 I need shell script snippet which read this file and change the format of the file to the below format 172.34.45.67 Host1 172.34.45.67 ... (9 Replies)
Discussion started by: sharsour
9 Replies

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

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

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

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

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

10. 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
Login or Register to Ask a Question
CSREQ(1)						    BSD General Commands Manual 						  CSREQ(1)

NAME
csreq -- Expert tool for manipulating Code Signing Requirement data SYNOPSIS
csreq [-v] -r requirement-input -t csreq [-v] -r requirement-input -b outputfile DESCRIPTION
The csreq command manipulates Code Signing Requirement data. It reads one requirement from a file or command arguments, converts it into internal form, checks it, and then optionally outputs it in a different form. The options are as follows: -b path Requests that the requirement read be written in binary form to the path given. -r requirement-input Specifies the input requirement. See "specifying requirements" below. This is exactly the same format as is accepted by the -r and -R options of the codesign(1) command. -t Requests that the requirement read be written as text to standard output. -v Increases the verbosity of output. Multiple instances of -v produce increasing levels of commentary output. In the first synopsis form, csreq reads a Code Requirement and writes it to standard output as canonical source text. Note that with text input, this actually compiles the requirement into internal form and then converts it back to text, giving you the system's view of the requirement code. In the second synopsis form, csreq reads a Code Requirement and writes its binary representation to a file. This is the same form produced by the SecRequirementCopyData API, and is readily acceptable as input to Code Signing verification APIs. It can also be used as input to subse- quent invocations of csreq by passing the filename to the -r option. SPECIFYING REQUIREMENTS
The requirement argument (-r) can be given in various forms. A plain text argument is taken to be a path to a file containing the require- ment. This program will accept both binary files containing properly compiled requirements code, and source files that are automatically com- piled for use. An argument of "-" requests that the requirement(s) are read from standard input. Again, standard input can contain either binary form or text. Finally, an argument that begins with an equal sign "=" is taken as a literal requirements source text, and is compiled accordingly for use. EXAMPLES
To compile an explicit requirement program and write its binary form to file "output": csreq -r="identifier com.foo.test" -b output.csreq To display the requirement program embedded at offset 1234 of file "foo": tail -b 1234 foo | csreq -r- -t FILES
DIAGNOSTICS
The csreq program exits 0 on success or 1 on failure. Errors in arguments yield exit code 2. SEE ALSO
codesign(1) HISTORY
The csreq command first appeared in Mac OS 10.5.0 . BSD
June 1, 2006 BSD