Sponsored Content
Top Forums Shell Programming and Scripting Output is not comming as expected Post 302612559 by methyl on Monday 26th of March 2012 06:28:41 AM
Old 03-26-2012
Environment variables are not files. Your $x is unsuitable for receiving more than one line.

Quote:
I actually want to avoid SPOOL command
Why? It is the sensible approach.
The link in post #2 has some useful tips about how to produce a correctly formatted CSV file.

Convention says use file extension ".csv" (not ".xls"). Only use ".xls" for a genuine old-format Microsoft Excel spreadsheet.
These 2 Users Gave Thanks to methyl For This Post:
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

scripting/awk help : awk sum output is not comming in regular format. Pls advise.

Hi Experts, I am adding a column of numbers with awk , however not getting correct output: # awk '{sum+=$1} END {print sum}' datafile 2.15291e+06 How can I getthe output like : 2152910 Thank you.. # awk '{sum+=$1} END {print sum}' datafile 2.15079e+06 (3 Replies)
Discussion started by: rveri
3 Replies

2. Shell Programming and Scripting

awk not generating the expected output

Hi, I am presently stuck in a csv file. INPUT CSV baseball,NULL,8798765,Most played baseball,NULL,8928192,Most played baseball,NULL,5678945,Most played cricket,NOTNULL,125782,Usually played cricket,NOTNULL,678921,Usually played EXPECTED OUTPUT CSV ... (7 Replies)
Discussion started by: scripter12
7 Replies

3. Shell Programming and Scripting

Not getting expected output

Hi I have written below script to get the data in table form. #!/bin/sh echo "File Name\tType" for i in *; do echo "$i\t\c" if ; then echo "directory" elif ; then echo "symbolic link" elif ; then echo "file" else echo "unknown" fi donehowever i am getting output in different way... (3 Replies)
Discussion started by: scriptor
3 Replies

4. Shell Programming and Scripting

awk - output comming strange: for operator ~ and == .

Hi awk experts, I am getting a strange output , may be it is normal but I am unable to comprehend, When Using == operator it is showing correct: # ls -l | awk '{for (i=0;i<=NF;i++) if ( $i =="info" )print $1,$6,$7,$8,$9}' drwx------ Jan 17 10:44 info But When using ~ (equal )... (4 Replies)
Discussion started by: rveri
4 Replies

5. Shell Programming and Scripting

Trying to learn to use functions in gawk and not getting expected output.

I've been working on improving my awk, and the next thing I want to learn is to properly use functions (I understand functions in shell and python). I have the following code which includes how I did this without functions before, and two attempts I've made to do it with functions: function... (3 Replies)
Discussion started by: DeCoTwc
3 Replies

6. Shell Programming and Scripting

Grep can't match expected but output all

lyang001@lyang001-OptiPlex-9010:~$ service --status-all |grep dbus acpid acpi-support alsa-restore alsa-store anacron apport atd avahi-daemon bluetooth cgroup-lite console-setup cron cups dbus dmesg dns-clean failsafe-x ... (1 Reply)
Discussion started by: yanglei_fage
1 Replies

7. Shell Programming and Scripting

awk output not what was expected

Good Moring, I am currently reading about awk in a manual and following the examples using the oratab file. My system is SOLARIS 10 I think I am getting strange behavior judging by what the book says to do and what I am getting with my little program. Here is my program: grep -v oratab |... (4 Replies)
Discussion started by: bdby
4 Replies

8. Shell Programming and Scripting

For loop not giving expected output

#cat /tmp/input old_array old_dev new_dev new_array 0577 008AB 01744 0125 0577 008AC 01745 0125 0577 008AD 005C8 0125 0577 008AE 005C9 0125 0577 008AF 005CA 0125 0577 008B0 005CB 0125 0577 008B1 005CC 0125 cat test.sh #!/bin/ksh... (4 Replies)
Discussion started by: mbak
4 Replies

9. Shell Programming and Scripting

awk not giving the output expected

Hello, I am practising awk and decided to compare two columns and print the result of the comparison as third column i/p data c1,c2,c3 1,a,b 1,b,b i am trying to compare the last two columns and if they match I am trying to print match else mismatch(Ideally i want that as a last column... (5 Replies)
Discussion started by: mkathi
5 Replies

10. Shell Programming and Scripting

Grep output to file result not as expected

Hi Gurus, I run command grep ABC file1 > file2 against below file. I got all ABC_xxx in one line in file2. I expect to get multiple lines in file2. If I print result in screen, the result is expected. thanks in advance My os is SunOS 5.10 Generic_150400-64 sun4v sparc sun4v ABC_123 XXXXX... (2 Replies)
Discussion started by: green_k
2 Replies
SSCONVERT(1)							       GNOME							      SSCONVERT(1)

NAME
ssconvert - a command line spreadsheet format converter SYNOPSIS
ssconvert [OPTIONS] infile outfile ssconvert [OPTIONS] --merge-to outfile infile1 infile2 ... DESCRIPTION
ssconvert is a command line utility to convert spreadsheet files between various spreadsheet file formats. It is a companion utility to Gnumeric, the powerful spreadsheet program created by the GNOME project. ssconvert accepts either file names or URIs as infile outfile. The special URIs fd://0 and fd://1 can be used for standard input and stan- dard output respectively. OPTIONS
This program follows the usual GNU command line syntax, with single letter options starting with a single dash (`-') and longer options starting with two dashes (`--'). Main options --recalc Recalculate all formulas before writing. --list-exporters List the available exporters (file formats). -T, --export-type=ID Specify which exporter to use; see below for a list. This is only necessary when the right format does not follow from the output file name. -O, --export-options=optionsstring Specify parameters for the chosen exporter. optionsstring is a list of parameter=value pairs, separated by spaces. The parameter names and values allowed are specific to the exporter and are documented below. Multiple parameters can be specified --list-importers List the available importers (file formats). -T, --import-type=ID Specify which importer to use; see below for a list. This is only necessary when the right format does not follow from the input file name. -E, --import-encoding=STRING Specify an encoding for imported content. -M, --merge-to=FILENAME Merge a collection of workbooks into one. Sheet size will expand to the largest in all the workbooks. Names in the scope of indi- vidual workbooks will end up in the scope of the merged workbook. The merge will be aborted if there are name conflicts. Help options -v, --version Display ssconvert's version. -h, --help, --usage Display a brief usage message. Path options -L, --lib-dir=STRING Set the root library directory. -D, --data-dir=STRING Adjust the root data directory. LIST OF IMPORTANT IDS
Gnumeric_XmlIO:sax Gnumeric's XML file format Gnumeric_Excel:excel_dsf Microsoft Excel (tm) 97/2000/XP & 5.0/95 format Gnumeric_Excel:xlsx Microsoft Excel (tm) 2007 ("Office Open XML", OOXML <http://en.wikipedia.org/wiki/XLSX> ) format Gnumeric_pdf:pdf_assistant Portable Document Format Gnumeric_stf:stf_assistant Text export (configurable) (*.txt) Gnumeric_stf:stf_csv Comma Separated Values LIST OF LESS IMPORTANT IDS
Gnumeric_sylk:sylk SYmbolic LinK (SYLK) <http://en.wikipedia.org/wiki/SYmbolic_LinK_(SYLK)> or Multiplan format Gnumeric_Excel:excel_biff8 Microsoft Excel (tm) 97/2000/XP format Gnumeric_Excel:excel_biff7 Microsoft Excel (tm) 5.0/95 format Gnumeric_dif:dif Data Interchange Format <http://en.wikipedia.org/wiki/Data_Interchange_Format> (*.dif) Gnumeric_html:roff TROFF <http://en.wikipedia.org/wiki/Troff> (*.me) format. Gnumeric_html:latex_table LaTeX 2e (*.tex) table fragment Gnumeric_html:latex LaTeX 2e (*.tex) Gnumeric_html:xhtml_range XHTML range - for export to clipboard Gnumeric_html:xhtml XHTML (*.html) Gnumeric_html:html40frag HTML (*.html) fragment Gnumeric_html:html40 HTML 4.0 (*.html) Gnumeric_html:html32 HTML 3.2 (*.html) Gnumeric_OpenCalc:openoffice OpenDocument <http://en.wikipedia.org/wiki/OpenDocument> or OpenOffice Calc <http://en.wikipedia.org/wiki/OpenOffice.org_Calc> (*.ods) format Gnumeric_paradox:paradox Paradox database <http://en.wikipedia.org/wiki/Paradox_(database)> (*.db) format OPTIONS FOR THE PORTABLE DOCUMENT FORMAT (*.pdf) EXPORTER sheet Name of the workbook sheet to operate on. paper Paper size. Valid values include "A4" for ISO A4 and "na_letter_8.5x11in" for US Letter. OPTIONS FOR THE CONFIGURABLE TEXT (*.txt) EXPORTER sheet Name of the workbook sheet to operate on. eol End Of Line convention; how lines are terminated. "unix" for linefeed, "mac" for carriage return; "windows" for carriage return plus linefeed. charset The character encoding of the output. Defaults to UTF-8. locale quote The character or string used for quoting fields. Defaults to """ (quotation mark / double quote). separator The string used to separate fields. Defaults to space. format Acceptable values: "automatic", "raw", or "preserve". transliterate-mode How to handle characters that cannot be represented in the chosen output character set. Acceptable values: "transliterate", or "escape". quoting-mode When does data need to be quoted? "never", "auto" (puts quotes where needed), or "always". Defaults to "never". quoting-on-whitespace Controls whether initial or terminal whitespace forces quoting. Defaults to TRUE. EXAMPLES
To convert the gnumeric file foo.gnumeric to a Microsoft Excel(TM) format file foo.xls: ssconvert foo.gnumeric foo.xls The export format can be specified explicitly, to override the default (which is based on the file extension): ssconvert --export-type=Gnumeric_stf:stf_csv foo.xls foo.txt To convert an Excel format file statfuns.xls to a text file, specifying the semicolon as the separator character: ssconvert -O 'separator=; format=raw' samples/excel/statfuns.xls statfuns.txt LICENSE
ssconvert is licensed under the terms of the General Public License (GPL), version 2. For information on this license look at the source code that came with the software or see the GNU project page <http://www.gnu.org>. COPYRIGHT
The copyright on the gnumeric software and source code is held by the individual authors as is documented in the source code. AUTHOR
ssconvert's primary author is Jody Goldberg <jody@gnome.org>; ssconvert builds on the gnumeric codebase. The initial version of this manpage was written by J.H.M. Dassen (Ray) <jdassen@debian.org>. SEE ALSO
gnumeric(1), ssgrep(1), ssindex(1) The Gnumeric Homepage <http://www.gnome.org/projects/gnumeric/>. The GNOME project page <http://www.gnome.org/>. gnumeric 2009-02-08 SSCONVERT(1)
All times are GMT -4. The time now is 05:07 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy