Before we upgraded our DB software, when we ran something like awk '{print $1,$2,$15}', the results were consistent.
Since upgrading, the last column can begin in position 15, 16 or 17.
Is there a way with awk to say go to eno-of-line and count back 5 characters?
I tried cut, but my delimter is a space " " and that doesn't help since spacing is irregular.
And I usually use sed to clean up data and I need to be able to assign $1, $2, and $15 to variables, so that is why we chose awk.
A sample line might look like:
ABC IXYZ123456 264525 2815 0 3 29 0 264525 28 87 3 0 0 *----
We get DB Name from $1, Tablename from $2 and $15 is the status. Certain character in certain places mean different things.
Sometimes it shifts a bit depending on the mix of the data.
Since upgrading, the last column can begin in position 15, 16 or 17.
Is there a way with awk to say go to eno-of-line and count back 5 characters?
I tried cut, but my delimter is a space " " and that doesn't help since spacing is irregular.
And I usually use sed to clean up data and I need to be able to assign $1, $2, and $15 to variables, so that is why we chose awk.
A sample line might look like:
ABC IXYZ123456 264525 2815 0 3 29 0 264525 28 87 3 0 0 *----
We get DB Name from $1, Tablename from $2 and $15 is the status. Certain character in certain places mean different things.
Sometimes it shifts a bit depending on the mix of the data.