Sponsored Content
Top Forums Shell Programming and Scripting Problem in writing the data to a file in one row Post 302369420 by rajeshorpu on Sunday 8th of November 2009 08:26:48 AM
Old 11-08-2009
Problem in writing the data to a file in one row

Hi All

I am reading data from the database and writing to temporary file in the below format.
1=XP|external_component|com.adp.meetingalertemail.processing.MeetingAlertEmail|EMAILALERTPUSH|32|4#XP |classpath|/usr/home/dfusr/lib/xalan.jar:
/usr/home/dfusr/lib/xerces.jar:
/usr/home/dfusr/lib/xml.jar:
/usr/home/dfusr/lib/classes12.zip

The data is writing in multiple rows as i want to write the same in one row for the same sequnce number. 1 in the above example

Find below the code i am retrieving from the database and writing to myJobTaskAttribListFile.


Code:
sqlplus -s $DBCredentials 1> $myJobTaskAttribListFile <<-EndOFSQL
SET DEFINE OFF;
SET SERVEROUT ON
SET LINESIZE 3400;
DECLARE
i_job_id NUMBER := $myJobId ;
o_run_status_id NUMBER := 0 ;
i_end_time VARCHAR2(1000) ;
i_total_errors NUMBER := 0 ;
i_total_warnings VARCHAR2(1000) ;
i_total_inserted NUMBER := 0 ;
i_total_updated NUMBER := 0 ;
i_total_rejected NUMBER := 0 ;
i_log_file VARCHAR2(1000) ;
i_job_run_message VARCHAR2(512) ;
i_modlast_by VARCHAR2(1000) ;
o_sqlcode NUMBER := 0 ;
o_sqlmsg VARCHAR2(1000) ;
BEGIN
$myUSPLoadJobTaskAttribs
(
i_job_id,
o_run_status_id,
o_sqlcode,
o_sqlmsg 
);

END; 
/
EndOFSQL

Please advice how can i write the same in one row for each sequnce number.

Thanks
Raj

Last edited by Neo; 11-08-2009 at 10:19 AM.. Reason: code tags
 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

help for a perl script - writing to a data file

Hi, Here is my problem.. i have 2 files (file1, file2).. i have wrote the last two lines and first 4 lines of "file2" into two different variables .. say.. my $firstrec = `head -4 $file2`; my $lastrec = `tail -2 $file2`; and i write the rest of the file2 to a tmpfile and cat it with head... (2 Replies)
Discussion started by: meghana
2 Replies

2. Shell Programming and Scripting

AWK Help- Writing Data into a File

Hi All, I need to maintain a AUDIT file in system for every incoming and outgoing file. For this i am trying to append a record by using the AWK every time the file arriving. I have used the code as below. AWK '{print "FILENAME IS", $1,"DATE IS", $2}' >> AUDITFILE.txt $1 and $2 are global... (1 Reply)
Discussion started by: Raamc
1 Replies

3. Shell Programming and Scripting

How to insert data befor some field in a row of data depending up on values in row

Hi I need to do some thing like "find and insert before that " in a file which contains many records. This will be clear with the following example. The original data record should be some thing like this 60119827 RTMS_LOCATION_CDR INSTANT_POSITION_QUERY 1236574686123083rtmssrv7 ... (8 Replies)
Discussion started by: aemunathan
8 Replies

4. Shell Programming and Scripting

writing data in a text file at particular line

I need to write value of variable $version at a particular line in a text file. Line number is determined by another variable &line......I don't know how to do it in shell script ... (2 Replies)
Discussion started by: punitpa
2 Replies

5. Programming

writing binary/struct data to file

I am trying to write binary data to a file. My program below: #include <stdlib.h> #include <stdio.h> struct tinner { int j; int k; }; struct touter { int i; struct tinner *inner; }; int main() { struct touter data; data.i = 10; struct tinner... (4 Replies)
Discussion started by: radiatejava
4 Replies

6. Shell Programming and Scripting

Reading data from DataBase and Writing to a file

Hi All, Please help me in writing data to a file in one row. In database there is a column which contains large data which does not fit in the file in one row. The column contains list of paths. I want to write these paths to a file in one row. Please find the code below writes : ... (2 Replies)
Discussion started by: rajeshorpu
2 Replies

7. Shell Programming and Scripting

validating data in columns and writing them to new file

I have a file that contains records in the below format: 23857250998423948239482348239580923682396829682398094823049823948 23492780582305829852095820958293582093585823095892386293583203248 23482038509825098230958235234230502958205983958235820358205892095... (10 Replies)
Discussion started by: shellhelp
10 Replies

8. Shell Programming and Scripting

Writing input data in file

I am having an input file for eg. file.txt which contains pipe delimited rows file.txt: xx|yyy|zz|12|3|aaaaa|..... yy|zz|1|3|4|xxxxx|....... . . . i want the above file name to be transformed into another file with giving input from the user and replacing the corresponding fields based... (5 Replies)
Discussion started by: rohit_shinez
5 Replies

9. Emergency UNIX and Linux Support

[Solved] Mysql - Take data from row and copy it to another row

Sorry if I repost my question in this section, but I'm really in a hurry since I have to finish my work... :( Dear community, I have a table with two rows like: Row1 Row2 ======= ======= 7,3 text 1 1,3 text 2 1,2,3 blabla What i need to do is add/copy... (2 Replies)
Discussion started by: Lord Spectre
2 Replies
SCOUT(1)						    http://en.opensuse.org/Sco							  SCOUT(1)

NAME
scout - A Package Scout SYNOPSIS
scout [global_options] {module} {search_term} [module_options] OPTIONS
The following options are available: global_options, module The global options are handled by scout itself. --format Specify the default output format. Choices are table (default), xml, csv. It's a replacement of the older scoutcsv, scoutxml links. --help Print a brief help. --version Print version. The respective module to search for. The following modules are available: autoconf Search for autoconf macros inside m4 files. bin Search for binaries contained in packages. header Search for C/C++/Obj-C/Obj-C++ headers java Search for Java classes inside packaged JAR files. python Search for Python modules. webpin Search in packages using the Webpin webservice. search_term The term you are looking for. module_options Additional module options. At the moment these are: --listrepos list all available repositories --repos=REPO, -r REPO select a repository to search (use a name from the --listrepos output) DESCRIPTION
Scout is a tool to look for uninstalled packages. For example, which binary does a package provide, which Java classes are available and which autoconf macros does a package contain. To search for your requested term, you need index data files which are a preconfigured SQLite 3 database. You have to install these in order to get your search request done. Use the Scout OBS data repository[1] to get additional index files. See the Wiki page about Scout[2] for more information. EXAMPLE 1: SEARCH FOR EXECUTABLES For example, to search for a sdl-config executable, you need the bin module: $ scout bin sdl-config You get the following output: repository | binary | path | package ------------+------------+-----------------------------+----------------- suse110 | sdl-config | /usr/bin | SDL-devel suse110 | sdl-config | /usr/lib/baselibs-32bit/bin | SDL-devel-32bit EXAMPLE 2: SEARCH FOR JAVA PACKAGES If you want to search for a Java package, use the following code: $ scout java org.apache.xml.serialize.Serializer You get: repository | package | jar | class ------------+------------------+---------------------+------------------------------------------------ jpackage17 | jboss4-testsuite | xerces.jar | org.apache.xml.serialize.Serializer jpackage17 | jboss4-testsuite | xerces.jar | org.apache.xml.serialize.SerializerFactory jpackage17 | jboss4-testsuite | xerces.jar | org.apache.xml.serialize.SerializerFactoryImpl jpackage17 | xerces-j2 | xerces-j2-2.9.0.jar | org.apache.xml.serialize.Serializer jpackage17 | xerces-j2 | xerces-j2-2.9.0.jar | org.apache.xml.serialize.SerializerFactory jpackage17 | xerces-j2 | xerces-j2-2.9.0.jar | org.apache.xml.serialize.SerializerFactoryImpl EXAMPLE 3: SEARCH THROUGH WEBPIN If you want to use the openSUSE Search Webservice[3]--also known as "Webpin"--use the following line: $ scout webpin docbook_5.xml You get: package | version | arch | repository URL | matched files -----------+---------+--------+-----------------------------------------------------------------------------------+------------------------ docbook_5 | 5.0 | noarch | http://download.opensuse.org/distribution/SL-OSS-factory/inst-source/suse | /etc/xml/docbook_5.xml docbook_5 | 5.0CR7 | noarch | http://download.opensuse.org/repositories/home:/thomas-schraitle/openSUSE_Factory | /etc/xml/docbook_5.xml docbook_5 | 5.0 | noarch | http://download.opensuse.org/repositories/XML/xml-factory | /etc/xml/docbook_5.xml BASH COMPLETION
If you like to complete your options automatically through Bash, insert the following lines into your ~/.bashrc or /etc/bash.bashrc: if [ -f /etc/bash_completion.d/scout.sh ]; then . /etc/bash_completion.d/scout.sh fi SEE ALSO
command-not-found(1) AUTHORS
Pavol Rusnak <stick@gk2.sk> Developer Michal Vyskocil <mvyskocil@suse.cz> Developer Ales Nosek <anosek@suse.cz> Index data for Java Pascal Bleser <guru@unixtech.be> Webpin code Marek Stopka <mstopka@opensuse.org> Bash completion Thomas Schraitle <toms@suse.de> Docbook documentation Klaus Kaempf <kkaempf@suse.de> Help with python-satsolver NOTES
1. Scout OBS data repository http://download.opensuse.org/repositories/home:/prusnak:/scout/data 2. Wiki page about Scout http://en.opensuse.org/Scout 3. openSUSE Search Webservice http://software.opensuse.org/search http://gitorious.org/opensus 08/07/2009 SCOUT(1)
All times are GMT -4. The time now is 09:06 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy