Sponsored Content
Top Forums Shell Programming and Scripting Set custom separator for sscovert Post 302976578 by nypreH on Friday 1st of July 2016 06:52:41 AM
Old 07-01-2016
Set custom separator for sscovert

Hi all,

I am exporting data from mysql table and need to represent data in xlsx file.
So, i am using below query to export data to csv:

Code:
SELECT * INTO OUTFILE 'OUT.csv' FIELDS TERMINATED BY ',' ENCLOSED BY '\"' LINES TERMINATED BY '\n' FROM $TABLE;

and then using ssconvert to convert from csv to xlsx:

Code:
ssconvert  OUT.csv FILE.xlsx

But the problem is that in the file there is fields where " symbol used so I am getting shift in the fields.

DB View:

Imageimage uploader

CSV View

Imageimage uploader

If I replace FIELDS TERMINATED BY to other symbol or ENCLOSED BY '\"' to other, then i am getting problems with ssconvert command since I can't specify field separator etc, so I am stuck with this issue Smilie

Is here anyone who was using extract data from DB to csv and from csv to xlsx and how such problem was solved?

---------- Post updated at 02:52 PM ---------- Previous update was at 12:49 PM ----------

Hi all,

Maybe it will be usefull for someone, problem has been solved by removin ENCLOSED BY '\"'
This User Gave Thanks to nypreH For This Post:
 

8 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How to set Field Separator for TCLSH??? :S

Hi, I am having a problem, with setting the FS in TCLSH, maybe someone knows the answer. I have a Tclsh/Tk script, and i´m trying to get all (only) the running processes for the given user like this: foreach process { puts stdout $process; } This also works, but... (2 Replies)
Discussion started by: laptop87
2 Replies

2. UNIX for Dummies Questions & Answers

How to set server's ip address, router, network mask and set if it is an internal or external ip?

Hello, I need to write a program which sets server's ip address, router, network mask. Program also should set if it is an internal or external ip. Maybe someone can help me ? Any information from u is very useful :b: I stopped at .. :( #!/bin/sh A=`hostname -i` echo "server ip address is $A"... (4 Replies)
Discussion started by: zagaruika
4 Replies

3. Shell Programming and Scripting

set Net:SSH:Expect timeout and set it again.

SSHing into a machine can take a few seconds, but after I'm in, the commands return quickly. I was wondering if the timeout setting can be changed once I'm logged into the machine. Does anyone know if this can be set on the fly? The problem here is, if I have to set timeout = 10, it'll take 10... (1 Reply)
Discussion started by: mrwatkin
1 Replies

4. Solaris

LC_ALL & LANG are set OK, but others couldn't set locale correctly.

Hi, I have a Solaris (SunOS 5.10) installed, by default with the en_AU.UTF-8 locale. I want to change it to en_US.UTF-8 With AU, I have no issues whatsoever, so I installed the language package and now locale -a shows "en_US.UTF-8". Problem is even with LC_ALL set in etc/default/init, the... (2 Replies)
Discussion started by: asdfg
2 Replies

5. Shell Programming and Scripting

[SOLVED] How to set field separator in awk when FS is "||" ?

Dear Experts, How to use field separator in awk , when the field separation is needed as "||" Example: (file1 ) aa || bb || cc || 1234 xx || yy || zz || 1123 Q: If I want to print $3 and $4 only , with using the field separator "||" How to write awk code: (6 Replies)
Discussion started by: rveri
6 Replies

6. Shell Programming and Scripting

Help needed with shell script to search and replace a set of strings among the set of files

Hi, I am looking for a shell script which serves the below purpose. Please find below the algorithm for the same and any help on this would be highly appreciated. 1)set of strings need to be replaced among set of files(directory may contain different types of files) 2)It should search for... (10 Replies)
Discussion started by: Amulya
10 Replies

7. Shell Programming and Scripting

Awk, with separator |

Friends have the following code that is correct. BEGIN { num_reg = 0 suma_iva=0 } { num_reg++ suma_iva=suma_iva+int(substr($0, 103,9)) } END{ printf ("%011d",suma_iva) } I have the following problem, I have to do just that but this time... (4 Replies)
Discussion started by: tricampeon81
4 Replies

8. Shell Programming and Scripting

Separator

Hello everybody, I'll get one more help I have a cabundle file that I need to separate into 2 parts, the first sequence and the second sequence, I thought of several things but I did not remember anything that could actually accomplish this separation and transform into 2 variables, first... (4 Replies)
Discussion started by: c0i0t3
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 01:07 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy