Sponsored Content
Special Forums UNIX Desktop Questions & Answers Extracting data from tables and storing in a file Post 302427928 by gini32 on Tuesday 8th of June 2010 09:57:48 AM
Old 06-08-2010
may b u can give following a try -
main changes being setting column seperator as "," and then some post formatting

Code:
#!/bin/ksh

touch tmpFile

sqlplus -s usr/passwd@sid << HERE | egrep -v "altered" > tmpFile
set feedback off
set linesize 9999
set colsep ","

select * from importcell;

HERE

sed -e "s/     //g" tmpFile | grep -v '^$' | grep -v "\-\-" > outfile.csv
rm tmpFile

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Converting tables of row data into columns of tables

I am trying to transpose tables listed in the format into format. Any help would be greatly appreciated. Input: test_data_1 1 2 90% 4 3 91% 5 4 90% 6 5 90% 9 6 90% test_data_2 3 5 92% 5 4 92% 7 3 93% 9 2 92% 1 1 92% ... Output:... (7 Replies)
Discussion started by: justthisguy
7 Replies

2. UNIX for Dummies Questions & Answers

Extracting Data from a File

Hi I need to calculate the number of occurrences of a item in a number of files using Perl. The item appears continually throughout the files but in each case I only want to calculate it in certain blocks of the file. Example - Calculalte the number of occurrences of a 'pass' in a block of... (0 Replies)
Discussion started by: oop
0 Replies

3. Shell Programming and Scripting

Extracting particular string in a file and storing matched string in output file

Hi , I have input file and i want to extract below strings <msisdn xmlns="">0492001956</ msisdn> => numaber inside brackets <resCode>3000</resCode> => 3000 needs to be extracted <resMessage>Request time getBalances_PSM.c(37): d out</resMessage></ns2:getBalancesResponse> => the word... (14 Replies)
Discussion started by: sushmab82
14 Replies

4. UNIX for Dummies Questions & Answers

Storing data from a table into a csv file

Hi I need to write a bash script to take the data stored in 3 oracle tables .. and filter them and store the results in a csv file. It is an Oracle database Thank you (1 Reply)
Discussion started by: ladyAnne
1 Replies

5. Shell Programming and Scripting

Extracting data from tables......

HOw to extracts data from tables in database. Merges them into one output file. This output file is loaded into another tables in database. (1 Reply)
Discussion started by: nari.bommi
1 Replies

6. Shell Programming and Scripting

Extracting columns from a matrix and storing each column in a separate file

Hi All, I have a huge matrix file consisting some some millions rows and 6000 columns. The contents are just floating point numbers in the matrix. I want to extract each column (i.e. 6000 of them) and store each column in a separate file. For example, 1.dat will consist of elements from column... (4 Replies)
Discussion started by: shoaibjameel123
4 Replies

7. Shell Programming and Scripting

Extracting specific lines of data from a file and related lines of data based on a grep value range?

Hi, I have one file, say file 1, that has data like below where 19900107 is the date, 19900107 12 144 129 0.7380047 19900108 12 168 129 0.3149017 19900109 12 192 129 3.2766666E-02 ... (3 Replies)
Discussion started by: Wynner
3 Replies

8. UNIX for Dummies Questions & Answers

Extracting data from file

I am trying to compare the data in lines 3 & 5 to see if they match up to the '-S570' (see first code set, all proprietary information has been removed from code set) spawn telnet Trying ... Connected to CA-LOS1234-ASE-S570.cl . Escape character is '^]'. CA-LOS1234-ASE-S570 Username: ... (1 Reply)
Discussion started by: slipshft
1 Replies

9. Shell Programming and Scripting

Extracting characters and storing in some variable

eg: ./myProgram.sh filename.cpp I want to remove the :".cpp" extension from the filename.cpp expected output: filename (3 Replies)
Discussion started by: umesh314
3 Replies

10. UNIX for Beginners Questions & Answers

Using bash script : How to Import data from a dsv file into multiple tables in mysql

HI I have a dsv file that looks like: <<BOF>> record_number|id_number|first name|last name|msisdn|network|points|card number|gender 312|9101011234011|Test Junior|Smith|071 123 4321|MTN|73|1241551413214444|M 313|9012023213011|Bob|Smith|27743334321|Vodacom|3|1231233232323244|M... (4 Replies)
Discussion started by: tera
4 Replies
cldump(1)							   User Manuals 							 cldump(1)

NAME
cldump - Clarion database extractor SYNOPSIS
cldump [options] database.dat DESCRIPTION
cldump extracts the data contained in a Clarion database; Clarion is a Windows IDE similar to Delphi or others, and has its own (simple) database format. cldump can extract the data contained in such a database, and export it to CSV, SQL (including the database schema, keys and indexes) or its own format (this format will give you all the meta information, but isn't easily parsable). A Clarion database consists in a set of files : .DAT files contain the data, .Kxx files contain the key/index data, .MEM files contain the memo entries associated to the data. OPTIONS
-x n, --decrypt n Decrypt an encrypted file. Required argument n indicates the location where the key will be retrieved. Valid values are in the range 1 - 4 inclusive. n = 1 usually works. Decryption happens in-place so KEEP A BACKUP as there is no guarantee the decryption process won't fail. Encrypted files must be decrypted before they can be dumped. Note that only the data file and the memo file are decrypted in this process; key/index files are left untouched as cldump doesn't use them. -d, --dump-active Dump active entries only -D, --dump-data Dump the actual data (active and deleted entries) -m, --dump-meta Dump meta information (no SQL or CSV output format exist for this option) -f c, --field-separator c Set the field separator to character c. Only valid for CSV output (see below). -c, --csv Dump data or schema in CSV format -S, --sql Dump data or schema in SQL format -s, --schema Dump database schema -M, --mysql Use MySQL specific construct (backticks, ...) -n, --no-memo Do not dump memo entries -U[charset], --utf8[=charset] Transcode strings and memos from charset to UTF-8 (charset defaults to ISO8859-1; for the list of supported charsets, see iconv --list) OUTPUT
cldump outputs the data to stdout or stderr depending on the output format selected, the data to extract and the type of the data (data, meta data). BUGS
The SQL output could be improved. Not all the types supported by the Clarion database format are implemented yet (due to lack of test data- bases using these types of data); see the source code for details. Please report bugs to jb@jblache.org; if possible, please send patches as the set of test databases I have is very limited. AUTHOR
cldump was written by Julien BLACHE <jb@jblache.org>. HOMEPAGE
http://www.technologeek.org/projects/cldump/ Linux November 2010 cldump(1)
All times are GMT -4. The time now is 05:50 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy