Sponsored Content
Top Forums Shell Programming and Scripting Convert data to a tabular format Post 302843522 by lazydev on Tuesday 13th of August 2013 03:29:25 PM
Old 08-13-2013
Convert data to a tabular format

How can i convert the below data to a simpler format :-

Code:
 
cat tabular.txt
 
User 1 Details :-
First Name = Tom
Middle Name =
Last Name = Hanks
Age = 40
Address =
User 2 details :-
 
First Name = Mike
Middle Name =
Last Name = Tyson
Age = 50
Address =

Want to display the output as :-

Code:
 
First Name Middle Name Last Name Age 
Tom                           Hanks       40 
Mike                           Tyson       50

Moderator's Comments:
Mod Comment quote tags != code tags

Last edited by DukeNuke2; 08-13-2013 at 04:37 PM.. Reason: changed quote to code tags
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

converting a tabular format data to comma seperated data in KSH

Hi, Could anyone help me in changing a tabular format output to comma seperated file pls in K-sh. Its very urgent. E.g : username empid ------------------------ sri 123 to username,empid sri,123 Thanks, Hema:confused: (2 Replies)
Discussion started by: Hemamalini
2 Replies

2. Shell Programming and Scripting

Convert array data to excel format

I need your help in changing the script I have data has below text file :> cat my_emp Employee array(0) Name : Albert No : 1234 Address: stationstraat City: Utrecht Employee array (1) Name : Kouwen No : 1256 Address: stationstraat City: Amsterdam Employee array (2) Name : Peter... (2 Replies)
Discussion started by: LinuxLearner
2 Replies

3. Shell Programming and Scripting

Displaying output in the tabular format

Hi I want to display the following input data into the tabular format as shown in the output. Input.txt: Following jobs are in pending state for more than 10 minutes: JOB_ID JOB_SUBMIT_ID MAHAR 784308 PUNJA 109367 Following jobs are running for longer time: JOB_ID... (1 Reply)
Discussion started by: dats
1 Replies

4. Shell Programming and Scripting

Generate tabular data based on a column value from an existing data file

Hi, I have a data file with : 01/28/2012,1,1,98995 01/28/2012,1,2,7195 01/29/2012,1,1,98995 01/29/2012,1,2,7195 01/30/2012,1,1,98896 01/30/2012,1,2,7083 01/31/2012,1,1,98896 01/31/2012,1,2,7083 02/01/2012,1,1,98896 02/01/2012,1,2,7083 02/02/2012,1,1,98899 02/02/2012,1,2,7083 I... (1 Reply)
Discussion started by: himanish
1 Replies

5. Shell Programming and Scripting

Extract data in tabular format from multiple files

Hi, I have directory with multiple files from which i need to extract portion of specif lines and insert it in a new file, the new file will contain a separate columns for each file data. Example: I need to extract Value_1 & Value_3 from all files and insert in output file as below: ... (2 Replies)
Discussion started by: belalr
2 Replies

6. Shell Programming and Scripting

Convert text file to HTML tabular format.

Please provide script/commands to convert text file to HTML tabular format. No need of styles and colours, just output and a heading in table is required. Output file will be send via email and will be seen from outlook. (script required without using awk). output file content: (sar... (7 Replies)
Discussion started by: Veera_V
7 Replies

7. Shell Programming and Scripting

Script to generate Excel file or to SQL output data to Excel format/tabular format

Hi , i am generating some data by firing sql query with connecting to the database by my solaris box. The below one should be the header line of my excel ,here its coming in separate row. TO_CHAR(C. CURR_EMP_NO ---------- --------------- LST_NM... (6 Replies)
Discussion started by: dani1234
6 Replies

8. Shell Programming and Scripting

Convert data into tabular matrix

Hi There, I want to convert the following data into tabular matrix, based on column 4th and 5th, and output the column 10th value chr1 2804449 2804450 NACpG_1 window1 + chr1 2804443 2804475 1 chr1 2804450 2804451 NACpG_1 window2 + chr1 2804443 ... (3 Replies)
Discussion started by: ChiragNepal
3 Replies

9. Shell Programming and Scripting

Convert csv data to html format

I am new to html and need to convert the attached csv file data to html format ; running into issues. please assist. #!/bin/ksh echo "<html>" ; echo "<head><style> table {border-collapse: collapse;} table, td, th {border: 1px solid black;} </style></head>" echo "<title> REPORT </title>" echo... (0 Replies)
Discussion started by: archana25
0 Replies

10. Shell Programming and Scripting

To have a mail in tabular format

Hello Guys, developing a monitoring shell script to have my queue depth count over mail . here is the sample input file to the script which has all the queue names 1 : DISPLAY QUEUE(*) WHERE (CURDEPTH GT 0) ZFC8409: Display Queue details. QUEUE(QL.GVR.ATA.CACHE.01) ... (10 Replies)
Discussion started by: wims
10 Replies
Boulder(3pm)						User Contributed Perl Documentation					      Boulder(3pm)

NAME
Boulder - An API for hierarchical tag/value structures SYNOPSIS
# Read a series of People records from STDIN. # Add an "Eligibility" attribute to all those whose # Age >= 35 and Friends list includes "Fred" use Boulder::Stream; my $stream = Boulder::Stream->newFh; while ( my $record = <$stream> ) { next unless $record->Age >= 35; my @friends = $record->Friends; next unless grep {$_ eq 'Fred'} @friends; $record->insert(Eligibility => 'yes'); print $stream $record; } Related manual pages: basics ------ Stone hierarchical tag/value records Stone::Cursor Traverse a hierarchy Boulder::Stream stream-oriented storage for Stones Boulder::Store record-oriented storage for Stones Boulder::XML XML conversion for Stones Boulder::String conversion to strings genome-related --------------- Boulder::Genbank parse Genbank (DNA sequence) records Boulder::Blast parse BLAST (basic local alignment search tool) reports Boulder::Medline parse Medline (pubmed) records Boulder::Omim parse OMIM (online Mendelian inheritance in man) records Boulder::Swissprot parse Swissprot records Boulder::Unigene parse Unigene records DESCRIPTION
Boulder IO Boulder IO is a simple TAG=VALUE data format designed for sharing data between programs connected via a pipe. It is also simple enough to use as a common data exchange format between databases, Web pages, and other data representations. The basic data format is very simple. It consists of a series of TAG=VALUE pairs separated by newlines. It is record-oriented. The end of a record is indicated by an empty delimiter alone on a line. The delimiter is "=" by default, but can be adjusted by the user. An example boulder stream looks like this: Name=Lincoln Stein Home=/u/bush202/lds32 Organization=Cold Spring Harbor Laboratory Login=lds32 Password_age=20 Password_expires=60 Alias=lstein Alias=steinl = Name=Leigh Deacon Home=/u/bush202/tanager Organization=Cold Spring Harbor Laboratory Login=tanager Password_age=2 Password_expires=60 = Notes:(1) There is no need for all tags to appear in all records, or indeed for all the records to be homogeneous.(2) Multiple values are allowed, as with the Alias tag in the second record.(3) Lines can be any length, as in a potential 40 Kbp DNA sequence entry.(4) Tags can be any alphanumeric character (upper or lower case) and may contain embedded spaces. Conventionally we use the characters A-Z0-9_, because they can be used without single quoting as keys in Perl associative arrays, but this is merely stylistic. Values can be any character at all except for the reserved characters {}=% and newline. You can incorporate binary data into the data stream by escaping these characters in the URL manner, using a % sign followed by the (capitalized) hexadecimal code for the character. The module makes this automatic. Hierarchical Records The simple boulder format can be extended to accommodate nested relations and other intresting structures. Nested records can be created in this way: Name=Lincoln Stein Home=/u/bush202/lds32 Organization=Cold Spring Harbor Laboratory Login=lds32 Password_age=20 Password_expires=60 Privileges={ ChangePasswd=yes CronJobs=yes Reboot=yes Shutdown=no } = Name=Leigh Deacon Home=/u/bush202/tanager Organization=Cold Spring Harbor Laboratory Login=tanager Password_age=2 Password_expires=60 Privileges={ ChangePasswd=yes CronJobs=no Reboot=no Shutdown=no } = As in the original format, tags may be multivalued. For example, there might be several Privilege record assigned to a login account. Each subrecord may contain further subrecords. Within the program, a hierarchical record is encapsulated within a "Stone", an opaque structure that implements methods for fetching and settings its various tags. Using Boulder for I/O The Boulder API was designed to make reading and writing of complex hierarchical records almost as easy as reading and writing single lines of text. Boulder::Stream The main component of the Boulder modules is Boulder::Stream, which provides a stream-oriented view of the data. You can read and write to Boulder::Streams via tied filehandles, or via method calls. Data records are flattened into a simple format called "boulderio" format. Boulder::XML Boulder::XML acts like Boulder::Stream, but the serialization format is XML. You need XML::Parser installed to use this module. Boulder::Store This is a simple persistent storage class which allows you to store several (thousand) Stone's into a DB_File database. You must have libdb and the Perl DB_File extensions installed in order to take advantage of this class. Boulder::Genbank Boulder::Unigene Boulder::OMIM Boulder::Blast Boulder::Medline Boulder::SwissProt These are parsers and accessors for various biological data sources. They act like Boulder::Stream, but return a set of Stone objects that have certain prescribed tags and values. Many of these modules were written by Luca I.G. Toldo <luca.toldo@merck.de>. Stone Objects The Stone object encapsulates a set of tags and values. Any tag can be single- or multivalued, and tags are allowed to contain subtags to any depth. A simple set of methods named tags(), get(), put(), insert(), replace() and so forth, allows you to examine the tags that are available, get and set their values, and search for particular tags. In addition, an autoload mechanism allows you to use method calls to access tags, for example: my @friends = $record->Friends; is equivalent to: my @friends = $record->get('Friends'); A Stone::Cursor class allows you to traverse Stones systematically. A full explanation of the Stone class can be found in its manual page. AUTHOR
Lincoln D. Stein <lstein@cshl.org>, Cold Spring Harbor Laboratory, Cold Spring Harbor, NY. This module can be used and distributed on the same terms as Perl itself. SEE ALSO
Boulder::Blast, Boulder::Genbank, Boulder::Medline, Boulder::Unigene, Boulder::Omim, Boulder::SwissProt perl v5.10.1 2011-03-05 Boulder(3pm)
All times are GMT -4. The time now is 12:39 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy