awk ( convert columns to row )

February 5, 2010 at 02:00:23
Specs: Windows XP
Hi,

Need help to process columns with null delimiter.

Input file is

A A
BBB
CCCC

Desired output-

C BC ABC ABC


See More: awk ( convert columns to row )

Report •

#1
February 5, 2010 at 02:16:44
I think spaces got distorted- here is another eg.
Input file has-
AAAA
BBBB
CCCC

Output needed is -
ABC ABC ABC ABC


Report •

#2
February 5, 2010 at 21:07:53
i don't know about awk, it might have the firepower to do it.
this worked on short tests:
for (( x=1;x<4;x++ )) ; do {
tt=$tt" "`cut -b$x<file.txt | tr -d "[\012]"`
}
done
echo $tt

note you have to set the line length (constant 4 in line 1) which might be done using wc or something like it.


Report •

#3
February 8, 2010 at 04:44:24
Hi,

Thanks for your reply..

In which shell was this coded.. Somehow i am getting syntax errors in all ksh, tcsh and bash..


Report •
Related Solutions


Ask Question