side by side concatenation

M

man.postman

I have an output

RowId Col1 Col2 Col3
...
...
...
...


--------------------------------------

RowId Col4 Col5 Col6

....
...
...

-----------------------------------------

I am trying to write a perl script to make it..

Row Id Col1 Col2 Col3 Col4 Col5 Col6

any advice???

thanks to everyone who responds....
 
G

Gunnar Hjalmarsson

I have an output

RowId Col1 Col2 Col3
..
..
..
..


--------------------------------------

RowId Col4 Col5 Col6

...
..
..

-----------------------------------------

I am trying to write a perl script to make it..

Row Id Col1 Col2 Col3 Col4 Col5 Col6

any advice???

Study the posting guidelines for this group:
http://mail.augustmail.com/~tadmc/clpmisc/clpmisc_guidelines.html

and let us know *what* you tried and how it failed to do what you want.

Also, you'd better provide more complete sample data, letting us know
for instance how the columns are separated and whether there is data in
each field.
 
T

Tad McClellan

I have an output

RowId Col1 Col2 Col3
..
..
..
..


--------------------------------------

RowId Col4 Col5 Col6

...
..
..

-----------------------------------------

I am trying to write a perl script to make it..

Row Id Col1 Col2 Col3 Col4 Col5 Col6

any advice???



Here is a program that does that:

===================================================
#!/usr/bin/perl
use warnings;
use strict;

my $output = 'RowId Col1 Col2 Col3
...
...
...
...


--------------------------------------

RowId Col4 Col5 Col6

....
...
...

-----------------------------------------
';

$output =~ s/RowId/Row Id/;
$output =~ s/RowId//;
$output =~ tr/a-zA-Z0-9/ /cs;

print "$output\n";
===================================================

thanks to everyone who responds....


You're welcome.

Have you seen the Posting Guidelines that are posted here frequently?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,902
Latest member
Elena68X5

Latest Threads

Top