Sponsored Content
Top Forums Shell Programming and Scripting Generating CSV from Column data Post 302870771 by rdrtx1 on Monday 4th of November 2013 04:56:56 PM
Old 11-04-2013
try also:
Code:
awk '!/:/ {sub("\n$", "", s); $0="," $1} {s=s $0 "\n";} END {printf s}' input

This User Gave Thanks to rdrtx1 For This Post:
 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

generating data for 1 hour

Hi Folks, The reqirement is that i need to generate 1 hr file with a time interval of five minutes.. For ex: my i/p is 0000-0000 and desired o/p is 0000-0005 0005-0010 0010-0015 0015-0020 0020-0025 0025-0030 0030-0035 0040-0045 0050-0055 0055-0100 Script neede urgent ... (0 Replies)
Discussion started by: aajan
0 Replies

2. Shell Programming and Scripting

generating a create ddl from a csv file using awk

Hello, I would greatly appreciate some help on the this I have comma delimited file as follows: csv file -------- TEST1,fld1,VARCHAR2,3,,, TEST1,fld2,DATE,,,, TEST1,fld2,VARCHAR2,51,,, TEST1,fld4,VARCHAR2,2,,, TEST1,fld5,NUMBER,4,0,, TEST1,fld6,VARCHAR2,1,,,... (5 Replies)
Discussion started by: jville
5 Replies

3. Shell Programming and Scripting

Compare 2 files and match column data and align data from 3 column

Hello experts, Please help me in achieving this in an easier way possible. I have 2 csv files with following data: File1 08/23/2012 12:35:47,JOB_5330 08/23/2012 12:35:47,JOB_5330 08/23/2012 12:36:09,JOB_5340 08/23/2012 12:36:14,JOB_5340 08/23/2012 12:36:22,JOB_5350 08/23/2012... (5 Replies)
Discussion started by: asnandhakumar
5 Replies

4. 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

5. 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

6. 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

7. 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

8. Shell Programming and Scripting

Adding new column data in csv from UNIX

Adding new column data in csv from UNIX Hi I need to add new column data daily to existing csv file. Please assist 7/11 7/10 7/9 7/8 space 10 GB 20 GB I was able to generate current day's data in csv but unable to add the previous 30 days data to the same csv Please use code tags,... (2 Replies)
Discussion started by: archana25
2 Replies

9. Shell Programming and Scripting

Is there a way to handle commas inside the data when generating a csv file from shell script?

I am extracting data via sql query and some of the data has commas. Output File must be csv and I cannot update the data in the db (as it is used by other application). Example table FavoriteThings Person VARCHAR2(25), Favorite VARCHAR2(100) Sample Data Greta rain drop on... (12 Replies)
Discussion started by: patk625
12 Replies
LedgerSMB::DBObject::Account(3pm)			User Contributed Perl Documentation			 LedgerSMB::DBObject::Account(3pm)

NAME
LedgerSMB::DBObject::Account - Base class for chart of accounts entries SYNOPSYS
This class contains methods for managing chart of accounts entries (headings and accounts). INERITS
LedgerSMB::DBObject METHODS
save() This method saves the chart of accounts entry. The hash component of the object may contain an id attribute, used to overwrite an account if that one exists. Hash entries Used: id: (optional): If set, overwrite existing account. accno: the text used to specify the account number description: Text to describe the account category: A = asset, L = liability, Q = Equity, I = Income, E = expense gifi_accno: The GIFI account entry control code heading: (Optional) The integer representing the heading.id desired contra: If true, the account balances on the opposite side. tax: If true, is a tax account link: a list of strings representing text box identifier. get() This method gets a chart of accounts entry. It requires that the $account->{id} value must be properly set. check_transactions() Returns true if the account has transactions, false if not. Also sets the $account->{has_transactions} value to the return value. $account->{id} must be set. is_recon Returns true if is set up for reconciliation. False otherwise. delete() Attempts to delete the account. This will NOT succeed if the account is referenced in any way by any transactions, credit accounts, etc. $account->{id} must be set. list() Returns a list of all accounts. generate_links() A mostly-private method for generating and checking whether link data is valid. This is usually done (automatically) in preparation for saving the information to the database. list_headings Returns a list of account_heading's. No inputs required. SEE ALSO
LedgerSMB::DBObject, LedgerSMB COPYRIGHT
Copyright (c) 2009, the LedgerSMB Core Team. This is licensed under the GNU General Public License, version 2, or at your option any later version. Please see the accompanying License.txt for more information. perl v5.14.2 2012-03-25 LedgerSMB::DBObject::Account(3pm)
All times are GMT -4. The time now is 12:58 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy