Oooooo SHINY!!! :) Thanks Bjorn. Will keep the code somewhere for later use.
I actually preferred NotePad++ instead of checking it in J for this because I had to remotely access the server with VNC. Unfortunately, I had to do it over VPN and its really slow. Chris actually admonished me before not to test code on production systems but instead have stub/test code on the local machines. I've learned my lessons since then but this is for one of my old projects (still running on J501). One cool thing about J is that when your application runs ... it will continue to run even over Hardware and OS upgrades. Just copy the whole project on the same drive and directory and run the registration batch file and it works again. :) No headaches. -----Original Message----- From: [email protected] [mailto:[email protected]] On Behalf Of Björn Helgason Sent: Wednesday, February 10, 2010 12:13 AM To: Programming forum Subject: Re: [Jprogramming] freadr messed up result Sorry copy pasted this a bit too fast NB. mark the lines below and send them over with ctrl+e f=: 4 : 0 smoutput 'parts of a' smoutput x {. y}. a smoutput 'parts of a using a.' smoutput a. i. x {. y}. a ) 2010/2/9 Björn Helgason <[email protected]>: > Here is an example how to use a collection of a few J statements to > make a simple analysis > > ---------------- put these lines into an ijs and execute one by one using > ctrl+r > a=.'abcd etc ',CRLF,' 1 2 3 4 5 ',CRLF,'jhfakjhf > idwhfakdhsfkhaiweuhfiwhf',CRLF,' line 4' > > NB. a is something you have read in using something like fread > > $a > > a. i. a > > a > > CR = a > > I. CR = a > > 10 {. 13}. a > > a. i. 10 {. 13}. a > > 10 {. 13}. a > > NB. mark the lines below and send them over with ctrl+e > f=: 4 : 0 > smoutput 'parts of a' > smoutput x {. y}. a > smoutput 'parts of a using a.' > smoutput a. i. 10 {. 13}. a > ) > 10 f 13 > > > 2010/2/9 Björn Helgason <[email protected]>: >> The nice thing about the ijx window is that there you are in "debug" >> mode all the time. >> >> In order to do analyses of operations it is possible to use the ijx >> directly but if I am testing more I tend to combine with the ijs and >> send individual lines over to the ijx by using ctrl+r and sometimes >> several lines with ctrl+e >> >> Analyzing what is going on inside verbs by using smoutput >> >> 2010/2/9 Björn Helgason <[email protected]>: >>> One editing error because I started to edit the line in the ijx window >>> before copying it >>> >>>> CR = 'abcd etc ',CRLF,' 1 2 3 4 5 ',CRLF >>>> abcd etc >>>> 1 2 3 4 5 >>> >>> Was of course like this >>> >>>> 'abcd etc ',CRLF,' 1 2 3 4 5 ',CRLF >>>> abcd etc >>>> 1 2 3 4 5 >>> >>> >>> 2010/2/9 Björn Helgason <[email protected]>: >>>> You do not need Notepad to analyse >>>> >>>> a. i. 'abcd etc ',CRLF,' 1 2 3 4 5 ',CRLF >>>> 97 98 99 100 32 101 116 99 32 13 10 32 49 32 50 32 51 32 52 32 53 32 13 10 >>>> CR = 'abcd etc ',CRLF,' 1 2 3 4 5 ',CRLF >>>> abcd etc >>>> 1 2 3 4 5 >>>> >>>> CR = 'abcd etc ',CRLF,' 1 2 3 4 5 ',CRLF >>>> 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 1 0 >>>> I. CR = 'abcd etc ',CRLF,' 1 2 3 4 5 ',CRLF >>>> 9 22 >>>> >>>> >>>> 2010/2/9 Alex Rufon <[email protected]>: >>>>> Hi Chris, >>>>> >>>>> Thanks. That was the problem! >>>>> >>>>> I don't know why they changed the output format ... but using NotePad++ >>>>> ... I can immediately see the jagged edges. >>>>> >>>>> @Bjorn, I was actually cutting the files the fourth time when I saw Chris >>>>> message. Still ... thank you. >>>>> >>>>> r/Alex >>>>> >>>>> -----Original Message----- >>>>> From: [email protected] >>>>> [mailto:[email protected]] On Behalf Of Chris Burke >>>>> Sent: Tuesday, February 09, 2010 6:59 PM >>>>> To: Programming forum >>>>> Subject: Re: [Jprogramming] freadr messed up result >>>>> >>>>> Alex Rufon wrote: >>>>>> Hi, >>>>>> >>>>>> This is a head scratcher. >>>>>> >>>>>> I've been using "freadr" to process outputs of an AS400 system. I've >>>>>> been using this for years without a hitch. >>>>>> >>>>>> Now I've got data that becomes messed up if I read it with "freadr". To >>>>>> work around the problem, I used: >>>>>> > cutopen freads 'filename' >>>>>> >>>>>> Unfortunately, the problem file I'm processing is around 19MB so I can't >>>>>> provide a sample. Each line of the file is delimited by CRLF. >>>>>> >>>>>> I know it's a bit vague but any ideas on the matter would be helpful. :) >>>>> >>>>> freadr requires the file to have fixed-length records. It sounds like >>>>> this new file has records of varying length. >>>>> ---------------------------------------------------------------------- >>>>> For information about J forums see http://www.jsoftware.com/forums.htm >>>>> ---------------------------------------------------------------------- >>>>> For information about J forums see http://www.jsoftware.com/forums.htm >>>>> >>>> >>>> >>>> >>>> -- >>>> Björn Helgason, Verkfræðingur >>>> Fornustekkum II >>>> 781 Hornafirði >>>> Po Box 127,801 Selfoss , >>>> t-póst: [email protected] >>>> gsm: +3546985532 >>>> sími: +3544781286 >>>> http://groups.google.com/group/J-Programming >>>> >>>> >>>> Tæknikunnátta höndlar hið flókna, sköpunargáfa er meistari einfaldleikans >>>> >>>> góður kennari getur stigið á tær án þess að glansinn fari af skónum >>>> /|_ .-----------------------------------. >>>> ,' .\ / | Með léttri lund verður | >>>> ,--' _,' | Dagurinn í dag | >>>> / / | Enn betri en gærdagurinn | >>>> ( -. | `-----------------------------------' >>>> | ) | (\_ _/) >>>> (`-. '--.) (='.'=) ♖♘♗♕♔♙ >>>> `. )----' (")_(") ☃☠ >>>> >>> >>> >>> >>> -- >>> Björn Helgason, Verkfræðingur >>> Fornustekkum II >>> 781 Hornafirði >>> Po Box 127,801 Selfoss , >>> t-póst: [email protected] >>> gsm: +3546985532 >>> sími: +3544781286 >>> http://groups.google.com/group/J-Programming >>> >>> >>> Tæknikunnátta höndlar hið flókna, sköpunargáfa er meistari einfaldleikans >>> >>> góður kennari getur stigið á tær án þess að glansinn fari af skónum >>> /|_ .-----------------------------------. >>> ,' .\ / | Með léttri lund verður | >>> ,--' _,' | Dagurinn í dag | >>> / / | Enn betri en gærdagurinn | >>> ( -. | `-----------------------------------' >>> | ) | (\_ _/) >>> (`-. '--.) (='.'=) ♖♘♗♕♔♙ >>> `. )----' (")_(") ☃☠ >>> >> >> >> >> -- >> Björn Helgason, Verkfræðingur >> Fornustekkum II >> 781 Hornafirði >> Po Box 127,801 Selfoss , >> t-póst: [email protected] >> gsm: +3546985532 >> sími: +3544781286 >> http://groups.google.com/group/J-Programming >> >> >> Tæknikunnátta höndlar hið flókna, sköpunargáfa er meistari einfaldleikans >> >> góður kennari getur stigið á tær án þess að glansinn fari af skónum >> /|_ .-----------------------------------. >> ,' .\ / | Með léttri lund verður | >> ,--' _,' | Dagurinn í dag | >> / / | Enn betri en gærdagurinn | >> ( -. | `-----------------------------------' >> | ) | (\_ _/) >> (`-. '--.) (='.'=) ♖♘♗♕♔♙ >> `. )----' (")_(") ☃☠ >> > > > > -- > Björn Helgason, Verkfræðingur > Fornustekkum II > 781 Hornafirði > Po Box 127,801 Selfoss , > t-póst: [email protected] > gsm: +3546985532 > sími: +3544781286 > http://groups.google.com/group/J-Programming > > > Tæknikunnátta höndlar hið flókna, sköpunargáfa er meistari einfaldleikans > > góður kennari getur stigið á tær án þess að glansinn fari af skónum > /|_ .-----------------------------------. > ,' .\ / | Með léttri lund verður | > ,--' _,' | Dagurinn í dag | > / / | Enn betri en gærdagurinn | > ( -. | `-----------------------------------' > | ) | (\_ _/) > (`-. '--.) (='.'=) ♖♘♗♕♔♙ > `. )----' (")_(") ☃☠ > -- Björn Helgason, Verkfræðingur Fornustekkum II 781 Hornafirði Po Box 127,801 Selfoss , t-póst: [email protected] gsm: +3546985532 sími: +3544781286 http://groups.google.com/group/J-Programming Tæknikunnátta höndlar hið flókna, sköpunargáfa er meistari einfaldleikans góður kennari getur stigið á tær án þess að glansinn fari af skónum /|_ .-----------------------------------. ,' .\ / | Með léttri lund verður | ,--' _,' | Dagurinn í dag | / / | Enn betri en gærdagurinn | ( -. | `-----------------------------------' | ) | (\_ _/) (`-. '--.) (='.'=) ♖♘♗♕♔♙ `. )----' (")_(") ☃☠ ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm
