Sponsored Content
Full Discussion: Help needed reading the file
Top Forums Shell Programming and Scripting Help needed reading the file Post 302597494 by chandu123 on Friday 10th of February 2012 12:47:05 PM
Old 02-10-2012
Help needed reading the file

I am reading a pipe delimted file having the 4 columns. The file content looks like
Code:
APT|string|Application ID For App|value

Code:
for env in `cat $ConfigFile`
do

        name=`echo $env | cut -d '|' -f1` 
        type=`echo $env | cut -d '|' -f2 
        prompt=`echo $env | cut -d '|' -f3`
        vval=`echo $env | cut -d '|' -f4` 
done

But for prompt the output is coming as "Application". I need the output as "Application ID For App" for prompt variable.
Please help.

Thanks,
Chandu123

Last edited by Franklin52; 02-11-2012 at 09:05 AM.. Reason: Please use code tags for data and code samples, thank you
 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Reading file names from a file and executing the relative file from shell script

Hi How can i dynamically read files names from a list file and execute them from a single shell script. Please help its urgent Thanks in Advance (4 Replies)
Discussion started by: anushilrai
4 Replies

2. Shell Programming and Scripting

URGENT HELP NEEDED ON -File size reading

All Expert, I am using Sun OS 5.8 and Perl version 5 in One server and Perl 5.8 in another unix server. I am able to read a file using fopen function of perl --file size having more then 3 GB of data.(In the machine where Perl 5.8 install) But when i am running the same perl script --It... (1 Reply)
Discussion started by: jambesh
1 Replies

3. Shell Programming and Scripting

Searching for Log / Bad file and Reading and writing to a flat file

Need to develop a unix shell script for the below requirement and I need your assistance: 1) search for file.log and file.bad file in a directory and read them 2) pull out "Load_Start_Time", "Data_File_Name", "Error_Type" from log file 4) concatinate each row from bad file as... (3 Replies)
Discussion started by: mlpathir
3 Replies

4. Shell Programming and Scripting

fatal: cannot open file `TNAME' for reading (No such file or directory)

Hi, I am running this command through a shell script and getting the error mentioned in the subject line: testing.awk -f x.txt TNAME My testing.awk file contains something like ++++++++++++++++++ #!/usr/bin/awk -f BEGIN{ TAB_NAME="INSERT_ONE_" ARGV ; } if ( $1=="JAM_ONE" &&... (1 Reply)
Discussion started by: kunwar
1 Replies

5. Shell Programming and Scripting

Help needed in reading line value into variable

I have a file which has data in 8 lines: 10 34 6 1 4 46 67 31 I am trying to read each value into each different variable so that I use these variables in preparing my report. Another option is to dynamically print each line values in the report like below: users with privA:... (2 Replies)
Discussion started by: sarat949
2 Replies

6. UNIX for Dummies Questions & Answers

Script reading needed

Hi, I'm just learning so I would appreciate some understanding line by line on the while loop/case script below. Thanks so much. joe. echo "Good Morning." echo "Enter 1 to Add" echo "or q to quit." while do read Enter case $Enter in 1) echo "Addtion:" echo... (3 Replies)
Discussion started by: jefferj54
3 Replies

7. UNIX for Dummies Questions & Answers

Reading XML file and print the values in the text file using Linux shell script

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>... (1 Reply)
Discussion started by: sravanreddy
1 Replies

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

9. Shell Programming and Scripting

ksh Script, Reading A File, Grepping A File Contents In Another File

So I'm stumped. First... APOLOGIES... my work is offline in an office that has zero internet connectivity, as required by our client. If need be, I could print out my script attempts and retype them here. But on the off chance... here goes. I have a text file (file_source) of terms, each line... (3 Replies)
Discussion started by: Brusimm
3 Replies
ENV(1)							    BSD General Commands Manual 						    ENV(1)

NAME
env -- set and print environment SYNOPSIS
env [-i] [name=value ...] [utility [argument ...]] DESCRIPTION
env executes utility after modifying the environment as specified on the command line. The option name=value specifies an environmental variable, name, with a value of value. The option '-i' causes env to completely ignore the environment it inherits. If no utility is specified, env prints out the names and values of the variables in the environment, with one name=value pair per line. EXIT STATUS
env exits with one of the following values: 0 utility was invoked and completed successfully. In this case the exit code is returned by the utility itself, not env. If no util- ity was specified, then env completed successfully and returned the exit code itself. 1 An invalid command line option was passed to env. 1-125 utility was invoked, but failed in some way; see its manual page for more information. In this case the exit code is returned by the utility itself, not env. 126 utility was found, but could not be invoked. 127 utility could not be found. COMPATIBILITY
The historic - option has been deprecated but is still supported in this implementation. SEE ALSO
execvp(3), environ(7) STANDARDS
The env utility conforms to IEEE Std 1003.2-1992 (``POSIX.2''). BUGS
env doesn't handle commands with equal (``='') signs in their names, for obvious reasons. BSD
June 8, 2007 BSD
All times are GMT -4. The time now is 07:59 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy