Help with awk, sed...

Adam Carlson acarlson at math.umass.edu
Fri Dec 21 08:10:31 AEST 1990


I have a REALLY screwed up data set that I need to format for use in a
statistical package.  My client is out of the country (I wonder why :-)
so I'm on my own.

The data is supposed to be in three columns representing 3 variables.
But the format I actually have is one long string.  To make matters
worse, the last number in one row and the first number in the next are
concatenated.  In other words, instead of

VarA    VarB    VarC
12.34   56      789.01234
98.76   54      321.09876
.
.
.

I have
VarA VarB VarC12.34 56 7890123498.76 54 321.09876...

Aside from the fact that the whole file is one line, so I can't run it
through AWK, it's a really messy problem anyway.  One saving grace, I
do know how many places are to the left and right of the decimal place
in each variable.  Is there any tool in Unix that will let me make
sense of this data other than writing a C program to do the
reformatting.  (Sadly I don't have perl :-()

Any response would be appreciated

BTW, I am on a Sun 3/80 Running SunOS 4.1

Please respond to
acarlson at math.umass.edu
Adam Carlson



More information about the Comp.unix.questions mailing list