Hello,
I am working on one script which is giving output as a pipe "|" separated
abcd | efgh | 20090745
abcdefgh | efg | 20090622
Can any one please help me i want it to be formatted as pipe will be aligned, or the output looks like a table.
Hello,
I am working on one script which is giving output as a pipe "|" separated
abcd | efgh | 20090745
abcdefgh | efg | 20090622
Can any one please help me i want it to be formatted as pipe will be aligned, or the output looks like a table.
awk -F'|' '{ printf("%20s|%20s|%20s\n", $1,$2,$3) }' yy
yy contains your Data
Thanks
Ashok
seems perl format can help you some.
format STDOUT =
@<<<<<<<<<<<<|@<<<<<<<<<<<<|@>>>>>>>>>>
$first $second $third
.
while(<DATA>){
($first,$second,$third)=split("[|]",$_);
write;
}
write;
__DATA__
abcd | efgh | 20090745
abcdefgh | efg | 20090622