perlquestion
SamCG
Hi monks,
So, I've got a file that was spit out of SQLPlus running in a command window in Windows. It seems to be breaking lines at 80 characters. The first set of lines looks like the header rows of the extract, and then the data comes. Nothing is lined up.
It pretty much looks like the following (except I did a lot of replacement below to obscure pretty much everything -- but you can see where I have data and where it's header).
I've been thinking going with pulling out by line numbers, though I'd have to get the pattern right -- I'd need lines 9-12, 23-26, 37-40, and so on... I guess add 11 and then get four lines? It just seems very clunky, and though the data looks pretty stable for at least 200 lines or so I just need one minor issue that would throw off everything.
Adding to the ugliness is that none of these things are tab-delimited. Maybe I go re-run the query over the weekend and hard-code tabs in.
And all this isn't even as ugly as what I actually need to do with this data (which would be okay, if my boss had any idea that if he asked anyone else to do this, they'd just tell him it was impossible >:|
<code>
IFDI_PXJPB_ID MJ_IFDI_CJYSP_HYJP_C
-------------------------------------------------- --------------------
CJYSP_MP
--------------------------------------------------------------------------------
CJYSP_SUI_MP
--------------------------------------------------------------------------------
CJYSP_ID CJYSP_ID_FJIP_CD PFB
-------------------------------------------------- -------------------- ---
XXXXXX99954499999-99999999_94334633_SPJS_334 XXXX
KHYSSPFKBUPP MFKPBIFJS FF IFC
KHYSSPFKBUPP MFKPBIFJS FF, IFC
SKS_3449436933_36559337_994 IF US
FJIP_IFKBJ_ID MJ_FJIP_CJYSP_HYJP_C
-------------------------------------------------- --------------------
CJYSP_MP
--------------------------------------------------------------------------------
CJYSP_SUI_MP
--------------------------------------------------------------------------------
CJYSP_ID CJYSP_ID_FJIP_CD PFB
-------------------------------------------------- -------------------- ---
SKSJCK39954494444-36559366_94334633_FJPX_994 XXXX
KKP MFIFCY F/P
KKP-MFIFCY F/P
SKS_3447994645_36559366_994 IF US
FJIP_IFKBJ_ID MJ_FJIP_CJYSP_HYJP_C
-------------------------------------------------- --------------------
CJYSP_MP
--------------------------------------------------------------------------------
CJYSP_SUI_MP
--------------------------------------------------------------------------------
CJYSP_ID CJYSP_ID_FJIP_CD PFB
-------------------------------------------------- -------------------- ---
SKSF43399543F9P49-36563753_94334633_FJPX_994 YBS
KDK PPC CYBP. YF CFFFDF
KDK CYBP YF FMPBICF PFYBYJJ
SKS_3443656944_36563753_994 IF US
</code>
<br/><br/>
<div class="pmsig"><div class="pmsig-300781">
<br/><br/>
-----------------<br/>
<sub>
s''limp';@p=split '!','n!h!p!';s,m,s,;$s=y;$c=slice @p[1];so brutally;d;$n=reverse;$c=$s**$#p;print(''.$c^chop($n))while($c/=$#p)>=1;
</sub>
</div></div>