Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

comment on

( #3333=superdoc: print w/replies, xml ) Need Help??
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 >:|
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




-----------------
s''limp';@p=split '!','n!h!p!';s,m,s,;$s=y;$c=slice @p1;so brutally;d;$n=reverse;$c=$s**$#p;print(''.$c^chop($n))while($c/=$#p)>=1;

In reply to Parsing a clunky file by SamCG

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (5)
As of 2022-05-20 14:17 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Do you prefer to work remotely?



    Results (73 votes). Check out past polls.

    Notices?