Sponsored Content
Full Discussion: Script to create a CSV file
Top Forums Shell Programming and Scripting Script to create a CSV file Post 302810849 by asnatlas on Wednesday 22nd of May 2013 03:25:32 PM
Old 05-22-2013
Quote:
Originally Posted by Chubler_XL
Try this

Code:
 your_script | awk '/^-/ { getline; S=$1 ; next }
S && /Connection/ {S=0}
S {print S","$1", etc" }'

That did not seem to work Smilie

In my script I have
Code:
done | tee -a ${logfile}

at the end. I tried running the above after commenting out the logfile. I get the following back:

Code:
,, etc862
,RC_Script1, etc
,RC_Script2, etcSERVER1
,RC_Script3, etcs863
                     Connection to SERVER1 closed.
,, etc863
,RC_Script1, etc
Connection to SERVER2 closed.
,RC_Script2, etc
,, etc866
,RC_Script, etc
,RC_Script1, etcSERVER3
,was-appservers, etcSERVER3
,was-dmgr, etc      SERVER3
,RC_Script2, etcSERVER3
,was-nodeagent, etcSERVER3
,RC_Script3, etcSERVER3
                     Connection to SERVER3 closed.

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

how to create csv file using shell script

I have a file in multiple directory which has some records in the following format File: a/latest.txt , b/latest.txt, c/latest.txt -> Name=Jhon Age=27 Gender=M Street=LA Road Occupation=Service I want to generate a csv file from the above file as follows File: output.csv -> ... (9 Replies)
Discussion started by: rjk2504
9 Replies

2. Shell Programming and Scripting

Help to create script which reade values from csv

I have a csv file :-my csv file has say 10 columns eg:- A,1,2,3,4,5,6,7,8,9 B,1,2,3,5,6,7,8,9 c,1,2,6,7,8,9 ----------------- I have to create a flat file from this file .The condition is each columns has fixed lenght declared: say length of column 1 = 1 length of column 2 =3 ... (1 Reply)
Discussion started by: Sanal
1 Replies

3. Shell Programming and Scripting

ksh script to create a generic csv file from different source formats

Hi all, I have a requirement to create a "superset" file out of a number of different sources with some different and some same columns. We intend to have a manually updateable SuperSetCols.csv which would look like "ColA","ColB","ColC","ColD","ColE","ColF","ColG" so someday we may add... (3 Replies)
Discussion started by: Leedor
3 Replies

4. Shell Programming and Scripting

Create an .csv/excel file using shellscript

In my file, i have 4 Product names(For ex:Microsoft excel, Oracle,.Net,IBM websphere,..etc.,) I want this 4 Products in 4 individual .csv/excel file after running the script with those products related information. (12 Replies)
Discussion started by: Navya
12 Replies

5. Shell Programming and Scripting

How to create multiline csv cell through shell script?

Hi, I have a text like the one given below status="Observation 1" read1="Source rows not load" read2="Score drop" I want to create a csv and mail it out in such a way that all three lines will be in a single cell but as three lines. For ex Col C1 ... (3 Replies)
Discussion started by: prasperl
3 Replies

6. Shell Programming and Scripting

Need help. How to create csv file?

Hi I'm a beginner and I have some problem. I have multiple files in the same directory which has one column but rows following the format. File: directory/Disk.txt Content: a b c d e File: directory/Memory.txt a b c d e File: directory/CPU.txt (3 Replies)
Discussion started by: thenuie
3 Replies

7. UNIX for Dummies Questions & Answers

How to Create excel file(.csv) using shell script?

Hi, i have shell script which compiles n number of test cases and execute them one by one. i want to create report in excel through script in which two columns namely "test id" and "release".second column have two subcolumns namely compiles and excutes. so i want first column should display test... (15 Replies)
Discussion started by: RamMore123
15 Replies

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

9. Shell Programming and Scripting

Create csv from text file

Gents, I am trying to create a csv file using the file attached. I have a problem to get all information required because the rows are not continues. Here is my code till now. awk ' /"ffid"/{if(s){print s;s=$NF}else{s=$NF}} /"LineNumber"/{s=s $NF} /"PointNumber"/{s=s $NF}... (4 Replies)
Discussion started by: jiam912
4 Replies

10. UNIX for Beginners Questions & Answers

awk and sed script to create one output CSV file

Hi All , I would require your help to generate one output file after post processing of one CSV file as stated below This file is just a small cut from a big file . Big file is having 20000 lines PATTERN,pat0,pat1,pat2,pat3,pat4,pat5,pat6,pat7,pat8,pat9... (2 Replies)
Discussion started by: kshitij
2 Replies
dat_cr_handoff(3DAT)				     Direct Access Transport Library Functions				      dat_cr_handoff(3DAT)

NAME
dat_cr_handoff - hand off the Connection Request to another Service Point SYNOPSIS
cc [ flag... ] file... -ldat [ library... ] #include <dat/udat.h> DAT_RETURN dat_cr_handoff ( IN DAT_CR_HANDLE cr_handle, IN DAT_CONN_QUAL handoff ) PARAMETERS
cr_handle Handle to an instance of a Connection Request that the Consumer is handing off. handoff Indicator of another Connection Qualifier on the same IA to which this Connection Request should be handed off. DESCRIPTION
The dat_cr_handoff() function hands off the Connection Request to another Service Point specified by the Connection Qualifier handoff. The operation is synchronous. This operation also destroys the Connection Request instance. Use of the handle of the destroyed Connection Request in any consequent operation fails. RETURN VALUES
DAT_SUCCESS The operation was successful. DAT_INVALID_HANDLE The cr_handle parameter is invalid. DAT_INVALID_PARAMETER The handoff parameter is invalid. ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Interface Stability |Standard: uDAPL, 1.1, 1.2 | +-----------------------------+-----------------------------+ |MT-Level |Unsafe | +-----------------------------+-----------------------------+ SEE ALSO
libdat(3LIB), attributes(5) SunOS 5.11 16 Jul 2004 dat_cr_handoff(3DAT)
All times are GMT -4. The time now is 10:47 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy