Sponsored Content
Top Forums Shell Programming and Scripting Need help putting output on one line Post 302629005 by brianjb on Tuesday 24th of April 2012 08:33:37 AM
Old 04-24-2012
When I run this, it doesn't get rid of the extra lines and condense them onto one line.

It does get rid of the first two fields on all lines except for line 1. How can I take this and put them all on the first line seperated by commas?

Here is what it looks like now:

Code:
9992 10.10.50.0/24
  blockAdminName="Username One"
  block_name="Servers"
  blockAdminEmail="username.one@people.com"
  blockAdminPhone="312-555-1212"
  blockAdminId="1234"
  blockSecName="Username Two"
  blockSecEmail="username.two@people.com"
  blockSecPhone="312-555-2121"
  blockSecId="7891"
  blockTechName="Username Three"
  blockTechEmail="username.three@people.com"
  blockTechPhone="312-555-1313"
  blockTechId="4567"

So thank you for getting me this far. How can I modify this awk statement to get them all into one line?
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Putting screen output in a log file

I want to output screen messages to a logfile when executing an automated script. I have tried the script and command to do this but with no luck. Thanks, Nicole (5 Replies)
Discussion started by: nsutti
5 Replies

2. Shell Programming and Scripting

Getting command output and putting into newfile

Hello All, I am using the below code: #!/bin/sh /omp/bin/TICLI "op:alarm,all" > filename for getting command output and then putting the output into newfile but the problem is this, that not the complete output goes into newfile and the script stops. for example: if this commands gives... (18 Replies)
Discussion started by: wakhan
18 Replies

3. Shell Programming and Scripting

Putting new line after certain number of character

Hi, I want, if a line is more than 80 characters length then put a new line with 4 space after each 80 characters to indent the data at same position. Input: 200 Geoid and gravity anomaly data of conjugate regions of Bay of Bengal and Enderby Basin: New constraints on breakup and early... (3 Replies)
Discussion started by: srsahu75
3 Replies

4. Shell Programming and Scripting

Putting multiple sed commands on a single line

Hi, I want to make sed write a part of fileA (first 7 lines) to file1 and the rest of fileA to file2 in a single call and single line in sed. If I do the following: sed '1,7w file1; 8,$w file2' fileA I get only one file named file1 plus all the characters following file1. If I try to use curly... (1 Reply)
Discussion started by: varelg
1 Replies

5. Shell Programming and Scripting

How to redirect the output to multiple files without putting on console

How to redirect the output to multiple files without putting on console I tried tee but it writes to STDOUT , which I do not want. Test.sh ------------------ #!/bin/ksh echo "Hello " tee -a file1 file2 ---------------------------- $>./Test.sh $> Expected output: -------------------... (2 Replies)
Discussion started by: prashant43
2 Replies

6. Shell Programming and Scripting

Putting echo output as input to stat

I have a string with escape differentiators as a result of searching for a file using find. Essentially find returned to my shell variable several absolute paths each ending with the file name and each path/file separated by \n. Echo recognizes the escape sequence and is able to print the paths... (3 Replies)
Discussion started by: Ebodee
3 Replies

7. Shell Programming and Scripting

putting color on output file script

do you have any simple script on how to change the color and font of a string in a script example echo "====================================" echo " sample color script" echo "====================================" echo " hello " echo " bye" on hello,... (3 Replies)
Discussion started by: lhareigh890
3 Replies

8. UNIX for Dummies Questions & Answers

Putting the Current -date in the Output File

Hi guys, Just want to ask how can I make a script that will perform like this. 1. Execute the command 2. Then the output of the command will be redirected to a file 2. The file that has been created will have a date on it equivalent to the date and time it was created (or maybe after the... (5 Replies)
Discussion started by: rymnd_12345
5 Replies

9. Shell Programming and Scripting

Identifying a sentence and putting it on a new line

I am revisiting the problem of sentence splitting. I have a Perl Script which splits a para into sentences, but acronyms and short forms create an issue #!/usr/bin/perl use feature qw/say/; use strict; use warnings; my $s; my @arr; while(<>) { chomp $_; $s .= $_ . " "; } @arr... (2 Replies)
Discussion started by: gimley
2 Replies

10. UNIX for Beginners Questions & Answers

Get an output of lines in pattern 1st line then 10th line then 11th line then 20th line and so on.

Input file: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 (6 Replies)
Discussion started by: Sagar Singh
6 Replies
Configure::Writer(3pm)					User Contributed Perl Documentation				    Configure::Writer(3pm)

NAME
XMLTV::Configure::Writer - Configuration file writer for XMLTV grabbers DESCRIPTION
Utility class that helps grabbers write configuration descriptions. SYNOPSIS
use XMLTV::Configure::Writer; my $result; my $writer = new XMLTV::Writer::Configure( OUTPUT => $result, encoding => 'iso-8859-1' ); $writer->start( { grabber => 'tv_grab_xxx' } ); $writer->write_string( { id => 'username', title => [ [ 'Username', 'en' ], [ 'Anvaendarnamn', 'sv' ] ], description => [ [ 'The username for logging in to DataDirect.', 'en' ], [ 'Anvaendarnamn hos DataDirect', 'sv' ] ], } ); $writer->start_selectone( { id => 'lineup', title => [ [ 'Lineup', 'en' ], [ 'Programpaket', 'sv' ] ], description => [ [ 'The lineup of channels for your region.', 'en' ], [ 'Programpaket foer din region', 'sv' ] ], } ); $writer->write_option( { value=>'eastcoast', text=> => [ [ 'East Coast', 'en' ], [ 'Oestkusten', 'sv' ] ] } ); $writer->write_option( { value=>'westcoast', text=> => [ [ 'West Coast', 'en' ], [ 'Vaestkusten', 'sv' ] ] } ); $writer->end_selectone(); $writer->end(); print $result; EXPORTED FUNCTIONS
None. METHODS
start() Write the start of the <xmltvconfiguration> element. Parameter is a hashref which gives the attributes of this element. write_string() Write a <string> element. Parameter is a hashref with the data for the element: $writer->write_string( { id => 'username', title => [ [ 'Username', 'en' ], [ 'Anvaendarnamn', 'sv' ] ], description => [ [ 'The username for logging in to DataDirect.', 'en' ], [ 'Anvaendarnamn hos DataDirect', 'sv' ] ], default => "", } ); perl v5.14.2 2010-04-24 Configure::Writer(3pm)
All times are GMT -4. The time now is 05:19 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy