Sponsored Content
Full Discussion: Simplified file conversion
Top Forums Shell Programming and Scripting Simplified file conversion Post 303017396 by manas_ranjan on Tuesday 15th of May 2018 09:42:35 AM
Old 05-15-2018
Simplified file conversion

Hi All,

I have a file like below
Code:
Topic:price   PartitionCount:5       ReplicationFactor:3     Configs:
        Topic: price  Partition: 0    Leader: 13      Replicas: 13,15,11      Isr: 11,13
        Topic: price  Partition: 1    Leader: 14      Replicas: 14,11,12      Isr: 11,12,14
        Topic: price  Partition: 2    Leader: 12      Replicas: 15,12,13      Isr: 12,13
        Topic: price  Partition: 3    Leader: 11      Replicas: 11,13,14      Isr: 11,14,13
        Topic: price  Partition: 4    Leader: 12      Replicas: 12,14,15      Isr: 12,14

I would like to convert this file into below
Code:
Topic, Partition, Replica Count, ISR Count(In-sync Replica Count)

ln-short the o/p file should look like below
Code:
Price, 0, 3, 2
price, 1, 3, 3
price, 2, 3, 2
price, 3, 3, 3
price, 4, 3, 2

Can anyone help me out?
 

10 More Discussions You Might Find Interesting

1. Solaris

COnversion utility xhtml file to Postscript file

Hi, Can any suggest me some utility to convert xhtml file to postscript file format? Also tell me from where to down load such utility.. With Regards, Dattatray (0 Replies)
Discussion started by: dattatray.b
0 Replies

2. Linux

Simplified find command to find multiple file types

Hi, I'm using the following command to find the multiple requierd file types and its working fine find . -name "*.pl" -o -name "*.pm" -o -name "*.sql" -o -name "*.so" -o -name "*.sh" -o -name "*.java" -o -name "*.class" -o -name "*.jar" -o -name "*.gz" -o -name "*.Z" -type f Though... (2 Replies)
Discussion started by: vickramshetty
2 Replies

3. Shell Programming and Scripting

shell or perl script needed for ldif file to text file conversion

This is the ldf file dn: sdcsmsisdn=1000000049,sdcsDatabase=subscriberCache,dc=example,dc=com objectClass: sdcsSubscriber objectClass: top postalCode: 29600 sdcsServiceLevel: 10 sdcsCustomerType: 14 givenName: Adelia sdcsBlackListAll: FALSE sdcsOwnerType: T-Mobile sn: Actionteam... (1 Reply)
Discussion started by: LinuxFriend
1 Replies

4. Shell Programming and Scripting

Conversion of below Tabs Tex file into CSV format file : shell script needed

Request if some one could provide me shell script that converts the below "input file" to "CSV format file" given Name Domain Contact Phone Email Location ----------------------- ------------------------------------------------ ------- ----- ---------------------------------... (7 Replies)
Discussion started by: sreenath1037
7 Replies

5. Shell Programming and Scripting

Conversion of spaces Text file into CSV format file

Input file (each line is separaed by spaces )given below: Name Domain Contact Phone Email Location ----------------------- ------------------------------------------------ ------- -----... (18 Replies)
Discussion started by: sreenath1037
18 Replies

6. Linux

File conversion and removing special characters from a file in Linux

I have a .CSV file when I check for the special characters in the file using the command cat -vet filename.csv, i get very lengthy lines with "^@", "^I^@" and "^@^M" characters in between each alphabet in all of the records. Using the code below file filename.csv I get the output as I have a... (2 Replies)
Discussion started by: dhruuv369
2 Replies

7. Shell Programming and Scripting

Simplified awk script for if else statements

Hi, The below awk script that i did is working fine. It gives me the results that i want. But, the script is not smart and very long as i have 8 conditions to meet. The sample script below only show 2 conditions. awk 'BEGIN{FS=OFS=" ~ |\t"} {if (($7>$9) && ($6>$8)){ Ql= $7-$6; Sl=... (6 Replies)
Discussion started by: redse171
6 Replies

8. What is on Your Mind?

New Simplified Log Out for UNIX.COM

Hi, I changed the logout code to just simply log out and go back to the page you were viewing: Was (ending code): eval(standard_error(fetch_error('cookieclear', create_full_url($vbulletin->url), $vbulletin->options, $vbulletin->session->vars), '', false)); Now: $goto = "Location:... (0 Replies)
Discussion started by: Neo
0 Replies

9. What is on Your Mind?

Simplified Registration Page with nCaptcha

At Ravinder's request, I have simplified the new member registration page on both mobile and desktop: Mobile: https://www.unix.com/members/1-albums214-picture909.jpeg Desktop (big image): https://www.unix.com/members/1-albums215-picture907.png (2 Replies)
Discussion started by: Neo
2 Replies

10. UNIX for Beginners Questions & Answers

Simplified Code? Acceptable?

Hi Folks - I have the following peice of code that I believe is uncecesarily long and I modified it to shorten it up. I was hoping one could comment and confirm my approach was acceptable? Original: if then pushd "${_INTRAPATH}" #Search for lines in... (1 Reply)
Discussion started by: SIMMS7400
1 Replies
TM::Materialized::JTM(3pm)				User Contributed Perl Documentation				TM::Materialized::JTM(3pm)

NAME
TM::Materialized::JTM - Topic Maps, trait for JSON Topic Map instances. SYNOPSIS
use TM::Materialized::JTM; my $tm=TM::Materialized::JTM(file=>"somefile.jtm"); $tm->sync_in; ... # map was modified, now save the changes $tm->sync_out; DESCRIPTION
This package provides map parsing and creating functionality for JTM (JSON Topic Map) instances. The JSON Topic Map format is defined here: <http://www.cerny-online.com/jtm/1.0/>. INTERFACE
Methods Constructor $tm = TM::Materialized::JTM->new (...); The constructor expects a hash as described in TM::Materialized::Stream, with one additional key/value parameter: o format (choices: "json", "yaml") This option controls whether the JTM data is treated as being in JSON format or in YAML (which is a superset of JSON). This applies to both reading and writing of map data. The default value is "json". format $tm->format('json'); $curformat=$tm->format; This method gets or sets the format parameter for future operations. Possible choices: "json", "yaml". SEE ALSO
TM::Serializable::JTM AUTHOR INFORMATION
Copyright 2010, Alexander Zangerl, All rights reserved. This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. http://www.perl.com/perl/misc/Artistic.html perl v5.10.1 2010-07-18 TM::Materialized::JTM(3pm)
All times are GMT -4. The time now is 04:42 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy