Sponsored Content
Top Forums Shell Programming and Scripting Parsing and filtering multiline text into comma separated line Post 302596505 by Scrutinizer on Tuesday 7th of February 2012 03:06:36 PM
Old 02-07-2012
You could scan for ------ and then print the next line:
Code:
awk '/-{6}/{getline;$1=$1;print}' OFS=, ORS= infile

to print a linefeed after the output:
Code:
awk '/-{6}/{getline;$1=$1;print} END{print RS}' OFS=, ORS= infile


Last edited by Scrutinizer; 02-07-2012 at 04:12 PM..
This User Gave Thanks to Scrutinizer For This Post:
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Parsing Comma separated Arguments

Hi unix guru's I want to execute a shell script like ksh printdetails.ksh Andy,Bob,Daisy,Johnson like passing all the four names in the as the arguments and these arguments are varies between 1 to 10. How to pass these names to the shell script variable. and also i want to know the count... (4 Replies)
Discussion started by: Reddy482
4 Replies

2. Shell Programming and Scripting

printing sequence of line no. with comma separated

Kindly i want to concatenate every 12 lines ina file, using a comma separator between fields (each line)? can anyone help please? thanks a lot in advance. (5 Replies)
Discussion started by: m_wassal
5 Replies

3. Shell Programming and Scripting

parsing comma separated file

Hi, I have a file with th elist of patches separated by comma, like below: patch1, patch 2, patch 3................ t\The number of patches is not known as it changes every time. I need assistance in writing a routine such as it will take patch1 as first variable and performs the... (4 Replies)
Discussion started by: avikaljain
4 Replies

4. Shell Programming and Scripting

Reading Words separated by comma in line

Hi All, I am facing issue, to read words in line, line as follow and i want to read word at each comma 1,you,are,two So i want read like 1 you are two Thanks (1 Reply)
Discussion started by: sujit_kashyap
1 Replies

5. UNIX for Dummies Questions & Answers

[solved] Comma separated values to space separated

Hi, I have a large number of files which are written as csv (comma-separated values). Does anyone know of simple sed/awk command do achieve this? Thanks! ---------- Post updated at 10:59 AM ---------- Previous update was at 10:54 AM ---------- Guess I asked this too soon. Found the... (0 Replies)
Discussion started by: lost.identity
0 Replies

6. Shell Programming and Scripting

Needs help in parsing comma separated values

hello experts, i am retrieving values in variables jobKey and jobName within my shell script. these values are returned to me within braces and i am using following command to remove those braces: jobKeys=`echo $jobKeys | sed 's:^.\(.*\).$:\1:'` jobNames=`echo $jobNames | sed... (1 Reply)
Discussion started by: avikaljain
1 Replies

7. Shell Programming and Scripting

Combining multiple block of lines in one comma separated line

Hi Everyone, On my Linux box I have a text file having block of few lines and this block lines separated by one blank line. I would like to format and print these lines in such a way that this entire block of lines will come as single comma separated line & again next block of lines in next... (7 Replies)
Discussion started by: gr8_usk
7 Replies

8. Shell Programming and Scripting

awk to change comma separated line to horizontal

I am trying to change a file that looks like this: file, announcement,date, server, server01, server02, server06, file04, rec01, rec04, rec03... etc into a vertical file like this: file announcement date server server01 server02 server06 The file does not have to be sorted... (5 Replies)
Discussion started by: newbie2010
5 Replies

9. Shell Programming and Scripting

Parsing Comma Separated values to UNIX variable from PLSQL

Hi All, I'm trying to pass the comma separated values (string) returned from Plsql Procedure to UNIX variable. getting the below log message cat: -: Bad file descriptor awk: cmd. line:1: fatal: error reading input file `-': Bad file descriptor The output coming from plsql procedure is... (3 Replies)
Discussion started by: Mahesh3089
3 Replies

10. UNIX for Advanced & Expert Users

AIX put comma separated data on its own line

In Linux you can do this to put comma separated data on its own line like this. sed 's/ */&\n/g' /tmp/ports sed 's/ */\n/g' /tmp/ports How do you do this in AIX? It is not working. Is there another way to do this? Something like this. 1, 2, 3, 4 To look like this. 1 2 3 4 (4 Replies)
Discussion started by: cokedude
4 Replies
Dt/Help.h(file formats) 												   Dt/Help.h(file formats)

NAME
Dt/Help.h -- help services definitions SYNOPSIS
#include <Dt/Help.h> DESCRIPTION
The Dt/Help.h header defines the variables and function prototypes for help services. The header defines the following DtHelpDialogCallbackStruct windowHint constants: DtHELP_POPUP_WINDOW DtHELP_CURRENT_WINDOW DtHELP_NEW_WINDOW The header defines the following DtHelpDialogCallbackStruct hyperType constants: DtHELP_LINK_JUMP_NEW DtHELP_LINK_TOPIC DtHELP_LINK_MAN_PAGE DtHELP_LINK_APP_DEFINE DtHELP_LINK_TEXT_FILE The header defines the following DtHelpDialogCallbackStruct reason constants: DtCR_HELP_LINK_ACTIVATE DtCR_HELP_CLOSE DtCR_HELP_HELP The header defines the following DtNScrollBarPolicy constants: DtHELP_NO_SCROLLBARS DtHELP_STATIC_SCROLLBARS DtHELP_AS_NEEDED_SCROLLBARS The header defines the following DtNhelpType constants: DtHELP_TYPE_TOPIC DtHELP_TYPE_STRING DtHELP_TYPE_MAN_PAGE DtHELP_TYPE_FILE DtHELP_TYPE_DYNAMIC_STRING The header defines the following DtNpaperSize constants: DtHELP_PAPERSIZE_LETTER DtHELP_PAPERSIZE_LEGAL DtHELP_PAPERSIZE_EXECUTIVE DtHELP_PAPERSIZE_A4 DtHELP_PAPERSIZE_B5 The header defines the following DtHelpQuickDialogGetChild constants: DtHELP_QUICK_CLOSE_BUTTON DtHELP_QUICK_PRINT_BUTTON DtHELP_QUICK_HELP_BUTTON DtHELP_QUICK_SEPARATOR DtHELP_QUICK_MORE_BUTTON DtHELP_QUICK_BACK_BUTTON The header defines the following DtHelpReturnSelectedWidgetId constants: DtHELP_SELECT_ERROR DtHELP_SELECT_VALID DtHELP_SELECT_ABORT DtHELP_SELECT_INVALID The header declares the following as functions: void DtHelpSetCatalogName(char *catFile); int DtHelpReturnSelectedWidgetId(Widget parent, Cursor cursor, Widget *widget); SEE ALSO
Dt/HelpDialog.h - DtHelpDialog(5), Dt/HelpQuickD.h - DtHelpQuickD(5), DtCreateHelpQuickDialog(3), DtCreateHelpDialog(3), DtHelpSetCatalog- Name(3), DtHelpReturnSelectedWidgetId(3), DtHelpDialog(3), DtHelpQuickDialog(3). Dt/Help.h(file formats)
All times are GMT -4. The time now is 11:24 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy