Sponsored Content
Top Forums Shell Programming and Scripting Adding new column data in csv from UNIX Post 303000415 by jim mcnamara on Tuesday 11th of July 2017 11:34:40 PM
Old 07-12-2017
Please give us expected output. It is not obvious how 4 dates relates to the word space followed by 4 values or two two-word values:
Code:
1. 10
2. GB
3. 20 
4. GB

Is your csv space delimited, what is the field delimiter?
 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

adding quotes around each column in a csv file

I saved the csv file in a comma delimited format. Sample input input.csv 1 abc 2 2 def 4 3 ghi 6 4 jkl 8 5 mno 10 output.csv should look like this with single quotes around each field '1' 'abc' '2' '2' 'def' '4' '3' 'ghi' '6' '4' 'jkl' '8' '5' 'mno' '10' Please help me :confused:... (3 Replies)
Discussion started by: melannie
3 Replies

2. UNIX for Dummies Questions & Answers

Use sed on column (csv) file if data in colmns is greater > than?

I have a data file that has 14 columns. I cannot use awk or perl but sed is installed on my host. I would like to delete a line if fields 10, 11 or twelve is greater than 999.99. How is this done using sed? :wall: sed '/^*,*,*,*,*,*,*,*,*,*,*,*,*,*,/d' infile 1 2 3 4 ... (2 Replies)
Discussion started by: Chris Eagleson
2 Replies

3. Shell Programming and Scripting

Adding a new column to a csv file

Hi, Can anyone please explain me how can I add a new column to a Csv file ? Actaully I am setting one set of commands and creating a CSV file with 4 columns. I am executing another command and it's output should be added as column 5 with a column heading ? Can anyone explain how can... (26 Replies)
Discussion started by: rrb2009
26 Replies

4. Shell Programming and Scripting

Script for extracting data from csv file based on column values.

Hi all, I am new to shell script.I need your help to write a shell script. I need to write a shell script to extract data from a .csv file where columns are ',' separated. The file has 5 columns having values say column 1,column 2.....column 5 as below along with their valuesm.... (3 Replies)
Discussion started by: Vivekit82
3 Replies

5. UNIX for Dummies Questions & Answers

Des/awk for change format and adding integers in a column of data?

Greetings! I need a quick way to change the format in a table of data Here is an example of the input: 10 72 Value=177 VDB=0.0245 Value4=0,0,171,0 10 274 Value=238 VDB=0.0433 Value4=29,0,205,0 10 312 Value=222 VDB=0.0384 Value4=8,0,190,19 10 540 Value=405 VDB=0.0391 Value4=13,30,153,195... (3 Replies)
Discussion started by: Twinklefingers
3 Replies

6. Shell Programming and Scripting

Generating CSV from Column data

Hi List, I have a chunk of data like so: User Account Control: User Account Control: User Account Control: User Account Control: Disabled User Account Control: User Account Control: User Account Control: Disabled User Account Control: User Account Control: ... (3 Replies)
Discussion started by: landossa
3 Replies

7. Shell Programming and Scripting

Compare 2 files of csv file and match column data and create a new csv file of them

Hi, I am newbie in shell script. I need your help to solve my problem. Firstly, I have 2 files of csv and i want to compare of the contents then the output will be written in a new csv file. File1: SourceFile,DateTimeOriginal /home/intannf/foto/IMG_0713.JPG,2015:02:17 11:14:07... (8 Replies)
Discussion started by: refrain
8 Replies

8. Shell Programming and Scripting

How to separate data coming in one column of CSV file?

I am running an ISQL command on Sybase DB and getting output of a query in an CSV file. The issue is that all the data comes in to the same column, i want them to be separated in different columns. SQL_COMMAND=command.sql file=file.txt formatFile=formatFile.txt report=report.csv echo... (1 Reply)
Discussion started by: Sharma331
1 Replies

9. Shell Programming and Scripting

Adding an extra date column in UNIX file

Hi All, I have a file with only one column of data (without delimiter). For Ex: cat temp.txt 22055 21088 93840 30990 50990 50950 I want to insert an additional column with current date as value. So, i have used below command but didn't get the result as excepted. Could onyone over... (5 Replies)
Discussion started by: Suresh
5 Replies
CSV2REC(1)							   User Commands							CSV2REC(1)

NAME
csv2rec - csv to rec converter SYNOPSIS
csv2rec [OPTIONS]... [CSV_FILE] DESCRIPTION
Convert csv data into rec data. -t, --type=TYPE type name for the converted records; if this parameter is ommited then no type is used. -s, --strict be strict parsing the csv file. -e, --omit-empty omit empty fields. --help print a help message and exit. --version show version and exit. AUTHOR
Written by Jose E. Marchesi. REPORTING BUGS
Report bugs to: bug-recutils@gnu.org GNU recutils home page: <http://www.gnu.org/software/recutils/> General help using GNU software: <http://www.gnu.org/gethelp/> COPYRIGHT
Copyright (C) 2010, 2011, 2012 Jose E. Marchesi. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>. This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. SEE ALSO
The full documentation for csv2rec is maintained as a Texinfo manual. If the info and csv2rec programs are properly installed at your site, the command info csv2rec should give you access to the complete manual. csv2rec 1.4.93 January 2012 CSV2REC(1)
All times are GMT -4. The time now is 08:35 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy