How to transpose pieces of data in a column to multiple rows?
Hello Everyone,
I am very new to the world of regular expressions. I am trying to use grep/sed for the following:
Input file is something like this and there are multiple such files:
I need to be able to edit the text in all of these files so that all the files look like this:
Kindly help me. Your help is much appreciated!
Moderator's Comments:
Kindly do wrap your samples into CODE TAGS, as per forum rules.
Last edited by RavinderSingh13; 10-09-2019 at 11:31 PM..
Hi,
I did read a few posts on the subjects, tried out a few solutions, but did not solve my problem.
https://www.unix.com/302121568-post11.html
https://www.unix.com/shell-programming-scripting/137953-large-file-columns-into-rows-etc-4.html
Please help. Problem very similar to the second link... (15 Replies)
Hello. very new to shell scripting and would like to know if anyone could help me.
I have data thats being pulled into a txt file and currently have to manually transpose the data which is taking a long time to do.
here is what the data looks like.
Server1 -- Date -- Other -- value... (7 Replies)
Hi Experts,
Can you please help me in transposing Datefield from rows to column and calculate the time difference for each of the Jobids:
Input File:
08/23/2012 12:36:09,JOB_5340
08/23/2012 12:36:14,JOB_5340
08/23/2012 12:36:22,JOB_5350
08/23/2012 12:36:26,JOB_5350
Required Output:... (6 Replies)
I can no longer find my commands, but I use to be able to transpose data with common fields from a single column to rows using a command line. My data is separated as follows:
NAME=BOB
ADDRESS=COLORADO
PET=CAT
NAME=SUSAN
ADDRESS=TEXAS
PET=BIRD
NAME=TOM
ADDRESS=UTAH
PET=DOG
I would... (7 Replies)
How to change the uploaded weekly file data to the following format?
New Well_Id,Old Well_Id,District,Thana,Date,Data,R.L,WellType,Lati.,Longi.
BAG001,PT006,BARGUNA,AMTALI,1/2/1978,1.81,2.29,Piezometer,220825,901430
BAG001,PT006,BARGUNA,AMTALI,1/9/1978,1.87,2.29,Piezometer,220825,901430... (3 Replies)
Hi I have below requirement, need help
One file contains the meta data information and other file would have the data, match the column from file1 and with file2 and extract corresponding column value and display in another file
File1:
CUSTTYPECD
COSTCENTER
FNAME
LNAME
SERVICELVL
... (1 Reply)
Dear all,
Plz let me know syntax for transposing rows into column in perl,
I am having 30 csv files which are merged into a single xls sheet.
but i want to transpose each row into column in excel sheet in each tab (1 CSV = 1tab in xls sheet)
example is as below
... (0 Replies)
Hi,
i am having an HDFS file which is comma seperated, i need to transpose from rows to column only the header columns
text.csv
cnt,name,place
1,hi,nz
2,hello,aus
I need
cnt,
name,
place
while using below command in hadoop getting the error
hadoop fs -fmt -1 text.csv (0 Replies)
hello,
I have a server that collect some performance statistics of 4 servers in the following input file :
$ cat inputfile
Time,A,Server1,KPI1,data1
Time,A,Server1,KPI2,data2
Time,A,Server1,KPI3,data3
Time,A,Server1,KPI4,data4
Time,A,Server1,KPI5,data5
Time,A,Server2,KPI1,data6... (9 Replies)
Discussion started by: capitain25
9 Replies
LEARN ABOUT DEBIAN
modperl::global
libapache2-mod-perl2-2.0.7::docs::api::ModPerl::Global(3User Contributed Perl Documentalibapache2-mod-perl2-2.0.7::docs::api::ModPerl::Global(3pm)NAME
ModPerl::Global -- Perl API for manipulating special Perl lists
Synopsis
use ModPerl::Global ();
my $package = 'MyApache2::Package';
# make the END blocks of this package special
ModPerl::Global::special_list_register(END => $package);
# Execute all encoutered END blocks from this package now
ModPerl::Global::special_list_call( END => $package);
# delete the list of END blocks
ModPerl::Global::special_list_clear( END => $package);
Description
"ModPerl::Global" provides an API to manipulate special perl lists. At the moment only the "END" blocks list is supported.
This API allows you to change the normal Perl behavior, and execute special lists when you need to.
For example "ModPerl::RegistryCooker" uses it to run "END" blocks in the scripts at the end of each request.
Before loading a module containing package $package, you need to register it, so the special blocks will be intercepted by mod_perl and not
given to Perl. "special_list_register" does that. Later on when you want to execute the special blocks, "special_list_call" should be
called. Unless you want to call the list more than once, clear the list with "special_list_clear".
API
"ModPerl::Global" provides the following methods:
"special_list_call"
Call the special list
$ok = special_list_call($key => $package);
arg1: $key ( string )
The name of the special list. At the moment only 'END' is supported.
arg2: $package ( string )
what package to special list is for
ret: $ok ( boolean )
true value if $key is known, false otherwise.
since: 2.0.00
"special_list_clear"
Clear the special list
$ok = special_list_clear($key => $package);
arg1: $key ( string )
The name of the special list. At the moment only 'END' is supported.
arg2: $package ( string )
what package to special list is for
ret: $ok ( boolean )
true value if $key is known, false otherwise.
since: 2.0.00
"special_list_register"
Register the special list
$ok = special_list_call($key => $package);
arg1: $key ( string )
The name of the special list. At the moment only 'END' is supported.
arg2: $package ( string )
what package to special list is for
ret: $ok ( boolean )
true value if $key is known, false otherwise.
since: 2.0.00
Notice that you need to register the package before it is loaded. If you register it after, Perl has already compiled the "END" blocks and
there are no longer under your control.
See Also
mod_perl 2.0 documentation.
Copyright
mod_perl 2.0 and its core modules are copyrighted under The Apache Software License, Version 2.0.
Authors
The mod_perl development team and numerous contributors.
perl v5.14.2 2011-02-08 libapache2-mod-perl2-2.0.7::docs::api::ModPerl::Global(3pm)