Trying To Write File Contents To Specfic .csv Cell


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Trying To Write File Contents To Specfic .csv Cell
# 8  
Old 04-21-2014
This method is losing the format. The 2 lines of text should only be in
Code:
r=2 -v c=3

Code:
1.1,1.2,1.3,1.4,1.5 2.1,2.2,"this is a two-line          replacement file",2.4,2.5 3.1,3.2,3.3,3.4,3.5

 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How to delete a columns of a CSV file which has cell values with a string enclosed in " , "?

Hi How can I delete a columns from a CSV file which has comma separated value with a string enclosed in double quotes or square bracket and a comma in between? I have a csv file with below format. Template,Target Server,Target Component,Rule Group,Rule,Rule Reference Number,Rule... (7 Replies)
Discussion started by: Litu19
7 Replies

2. UNIX for Dummies Questions & Answers

Write terminal contents into a one file in UNIX

Hi guys, How to write terminal contents into a file in Unix operating system Actually I created GUI by using Gtk2-perl. I want to display data on GUI whatever the contents writing on terminal. So which command I have to use and where that command to be run I mean in shell script or Perl... (2 Replies)
Discussion started by: kiran425
2 Replies

3. Shell Programming and Scripting

How to delete a column/columns of a CSV file which has cell values with a string enclosed in " , "?

How can I delete a column from a CSV file which has comma separated value with a string enclosed in double quotes and a comma in between? I have a file 44.csv with 4 lines including the header like the below format: column1, column2, column3, column 4, column5, column6 12,455,"string with... (6 Replies)
Discussion started by: dhruuv369
6 Replies

4. Shell Programming and Scripting

Write array contents to file

Hi, I have a bash script that currently holds some data. I am trying to write all the contents to a file called temp.txt. I am using echo ${array} > temp.txt The problem that I am experiencing is that the elements are being written horizontally in the file. I want them written... (5 Replies)
Discussion started by: Filter500
5 Replies

5. Shell Programming and Scripting

Extract last cell of csv file

How do I extract the last cell in a column of a csv file using linux shell scripting? Or alternatively, how do I get the number of cells of a csv file? (2 Replies)
Discussion started by: locoroco
2 Replies

6. Shell Programming and Scripting

Store table contents in csv file

I need to write a script to store the contents of a table in a csv file I'm using Toad, it's a Oracle database. (5 Replies)
Discussion started by: ladyAnne
5 Replies

7. UNIX for Advanced & Expert Users

How to add two values in the same cell of CSV file

I need help to create a csv file with Unix command. In csv file, i need to put two values in the same cell. Rite now, whts happening is, if i put 2 values in the same cell, its comming as " asd, zxc" but i want it in different line but in same cell. asd zxc Please reply me ASAP. (1 Reply)
Discussion started by: Prashant Jain
1 Replies

8. Shell Programming and Scripting

How to edit particular cell of csv file using shell script

I have one csv file and in that I want update particular cell. I know the row and coloumn number for that respective. Please help me... (6 Replies)
Discussion started by: deepak_p86
6 Replies

9. Shell Programming and Scripting

Need to compare two csv files values and write into another csv file

Hi all, Am new to scripting. So i just need your ideas to help me out. Here goes my requirement. I have two csv files 1.csv 2.csv abc,1.24 abc,1 def,2.13 def,1 I need to compare the first column of 1.csv with 2.csv and if matches then need to compare... (2 Replies)
Discussion started by: chinnahyd
2 Replies

10. Programming

How to read and write directory or file contents in c++ ?

Dear Friends, I m beginner unix programmer. I want to know, how to read and write directory or file contents in c++ ? (3 Replies)
Discussion started by: namrata5
3 Replies
Login or Register to Ask a Question
CSV2LATEX(1)						      General Commands Manual						      CSV2LATEX(1)

NAME
csv2latex -- convert a csv file into a LaTeX document SYNOPSIS
csv2latex [--nohead] [--longtable] [--noescape] [--guess] [--separator c|s|t|p|l] [--block q|d|n] [--lines #] [--position l|c|r] [--colorrows 0-1] [--reduce 1|2|3|4] [--repeatheader] [--nohlines] [--novlines] [file] DESCRIPTION
This manual page documents the csv2latex program. csv2latex is a program that reads a "comma separated values" (csv) file and outputs a LaTeX file with one or more tabular environments to display the printable values of the csv file. The LaTeX code is flushed on the standard output. So-called "comma separated values" files are common formats for exchanging two-dimensinal tables between programs such as spreadsheets edi- tors, to represent almost any kind of data. By default, a csv file is made of printable data separated by commas (`,'), each comma repre- senting a `cell' separator, and each line representing a row. By extension, cell separators can be represented by tabs if the comma is con- sidered as printable data. Moreover, some non true csv files can be assumed as two-dimensional tables as well. In some circumstances, if the printable data includes the cell separator of the exchange format, the latter can use a second extra character to embrace the printable data into a block (e.g: quoted text). Thus, it is still possible to parse the file by using the block delimiter (used twice to embrace the cell) instead of the separator. csv2latex aims to parse various csv formats plus formats that fits into the above definiton, assuming the data is text, and to produce a yet simple LaTeX file using the "tabular" environment for a table-style layout. Some options of output will also use macros provided by extra LaTeX packages that are commonly included in the main LaTeX distributions. OPTIONS
This program follows the usual GNU command line syntax, with long options starting with two dashes (`-'). A summary of options is included below. -h --help Show summary of options. -v --version Show version of program. -n --nohead Do not output the LaTeX document header. This is useful when the output is to be included as a separate file into the master document. -t --longtable uses the 'longtable' package instead of the 'tabular' one. This is useful when the input is long, with --lines 0 option. This option uses the extra `longtable' LaTeX package. If you also use --nohead option, do not forget to add the following line into the header of your master document: "usepackage{longtable}". -x --noescape Do not escape TeX control characters from the input. This is useful when the input contains already TeX code. -g --guess Try to guess the csv format. This is useful when the input is not strictly a comma separated set of printable data. For exam- ple, a line like %Foo, Bar%:%Wizz: Hey% may be parsed as "Foo, Bar" then "Wizz: Hey". -s c|s|t|p|l --separator c|s|t|p|l Set the given separator as cell separator of the csv format. `c' means a comma (default). `s' means a semicolon. `t' means a tab. `p' means a space. `l' means a colon. -b q|d|n --block q|d|n Set the given block delimiter that embraces the printable data of the csv format. `q' means a simple quote. `d' means a double quote. `n' means no quoting at all (default). -l # --lines # Force to output multiple tabulars, each having a limited number of lines. The given argument must be a POSITIVE INTEGER VALUE. This is useful when the number of input rows is too big to fit into a single papersheet. A good average for a4 paper is about 40 lines (default). 0 means infinity (actualy about 2 Giga lines). -p l|c|r --position l|c|r Set the text position in all cells at once. This simply uses one of the three basic cell formating options of the LaTeX tabular environment. `l' means left-aligned (default). `c' means centered. `r' means right-aligned. -c 0-1 --colorrows 0-1 Alternate white/gray rows on the LaTeX output, having the given graylevel. The given argument must be a REAL NUMBER BETWEEN 0 AND 1. 0 means black while 1 means white. A nice looking value is 0.75 when printed on white paper. This option uses the extra `colortbl' LaTeX package. If you also use --nohead option, do not forget to add the following line into the header of your mas- ter document: "usepackage{colortbl}". -r 1|2|3|4 --reduce 1|2|3|4 Reduce the size of the tabular and the font in the LaTeX output, given a reduction level. The given argument must be one of 1, 2, 3 or 4. The more the level is high, the more the tabular will appear small. This is useful to shrink the table width when the printable data is made of very long text. This option uses the extra `relsize' LaTeX package. If you also use --nohead option, do not forget to add the following line into the header of your master document: "usepackage{relsize}". -z --nohlines Do not output horizontal lines in the table(s). -y --novlines Do not output vertical lines in the table(s). -e --repeatheader Repeat the first row of the first table in every table. This is useful when the output is very long and separated in multiple tables. EXAMPLES
Create a PDF document with small text, alternate gray rows, 80 lines per table, from a guessed csv format of the january stats that my boss created with his super point-and-click spreadsheet program (which could not generate a PDF output!). csv2latex --guess --lines 80 --colorrows 0.75 --reduce 2 january_stats.csv > january_stats.tex && pdflatex january_stats.tex Quickly preview a phonebook from a file formated as "Surname" "Name" "Phone" "Cellular": csv2latex -s p -b d -l 42 phonebook-sorted.txt | latex SEE ALSO
tex (1), latex (1). CSV2LATEX(1)