English
Forum

Gibt's as a commands for?

 

Matthias
Badzun
Moin moin,

i'm Umsteiger of Turbo-/Power-Basic with well 10-jährigem "Schaffensloch" and I therefore a problem (V.11 Full Version)

I must Variabele a on itself sequenziellen File reading, The but some Lines contains in them several Variabele with Kommata separated vorkommen. Number and type this Variabelen is in this Lines always same, Strings and numbers mixed, Strings are additional within "".

example:
--------------------------------------------------------
15840
1
13,13,6,20,11,12,15
550
595
600
385
390
1,81074,36626,"Herr",36526,"Unbekannt","Diagnose","€","Schlusstext, 2. Zeile"
3
--------------------------------------------------------

The strings can also Sonderzeichen, point and Kommata as well as <LF> and <CR> include, but no "" within one Stringtextes. The Textlängen are vaguely.

with my middle-aged Basic-mutants was no trouble (unfortunately but not windows-capable), but in XProfan 11 have I moreover yet nothing funktionierendes discover. but there it Yes "geht nicht" not gives, can me certainly someone moreover help.

beforehand many Thanks
Greeting, Matthias
 
Gruß,
Matthias
12/08/08  
 




Christian
Eichler
what I personally, as someone the straight on C umsteig, in this drop make would is the following:

i'd each letters particular vergleichen and thereby The " mitzählen. is The Number of " ungerade is the , inside the ", is tappt im dunkeln straight deals it itself objectively for a Trennkomma.

this is blos ne spontane idea of me been.

BTW: Überprüfen, whether a number straight or not can wonderful with Modulo 2

Regards Christian
 
Debian Lenny, Intel Celeron 2,8 Ghz, 768 MB Ram && Win XP Pro, Intel C2D 1,66Ghz, 2 GB Ram ... PROFAN² 6.6
12/08/08  
 




Frank
Abbing
are each Lines through <CR> separated?
is naturally everything machbar, only are missing another couple Info. If the Files not straight gigantic tall are, would I tappt im dunkeln in a area loading and then parsen.
 
12/08/08  
 




Matthias
Badzun
The Files can 300~400 kB big his, teoretisch too larger but in the practice sooner not. The Lines are through <CR><LF> separated. but inerhalb the Strings can ditto <CR><LF> as Line break in the Klartext to come, which in EDITOR so present. The can then naturally not as end the Datenzeile interprets go.
 
Gruß,
Matthias
12/08/08  
 




Dietmar
Horn
Hello Matthias,

i'd The File sequentiell reading and each Line in of/ one Loop with SubStr$ durchforsten (with comma as Separator), To nothing more comes (see XProfan-Help Substr$).

The strings erkennst You then Yes on whom quotation marks, The You with Instr to check on can.
with only 300 To 400 KB should the 1-2-fix weg.

there might then too <CR><LF> inside the Strings not disturbing.

Greeting
Dietmar
 
Multimedia für Jugendliche und junge Erwachsene - MMJ Hoyerswerda e.V.  [...] 

Windows 95 bis Windows 7
Profan² 6.6 bis XProfan X2 mit XPSE

Das große XProfan-Lehrbuch:  [...] 
12/08/08  
 




Frank
Abbing
Yes, comes <CR><LF> within quotation marks to, find tappt im dunkeln itself in in the string. otherwise separate tappt im dunkeln each Lines voneinander ex. i'd everything in a area reading and zeichenorientiert parsen.
 
12/08/08  
 



Matthias Badzun
I must Variabele a on itself sequenziellen File reading, The but some Lines contains in them several Variabele with Kommata separated vorkommen. Number and type this Variabelen is in this Lines always same, Strings and numbers mixed, Strings are additional within "". The strings can also Sonderzeichen, point and Kommata as well as <LF> and <CR> include, but no "" within one Stringtextes. The Textlängen are vaguely.


would be I by aray solve.

Have "einladen" and "getxy" on obiges adjusted, that with the whom Strings works.
CompileMarkSeparationor.
CompileMarkSeparation
DECLARE MYDATA.STRINGS$[]
DECLARE MYDATA$[]
MYDATA$[]=MYDATA.LOADFROMSTRING(FGC("meineDatei"))
CLS
PRINT "Zeilen:",SIZEOF(MYDATA$[])
PRINT "1,1:",MYDATA.GETXY(1,1)
PRINT "3,3:",MYDATA.GETXY(3,3)
PRINT "1,5:",MYDATA.GETXY(1,5)
PRINT "3,9:",MYDATA.GETXY(3,9)
PRINT "4,9:",MYDATA.GETXY(4,9)
PRINT "6,9:",MYDATA.GETXY(6,9)
WAITINPUT
end

proc MYDATA.LOADFROMSTRING

    PARAMETERS DATA$
    DECLARE LNS$[]
    CLEAR MYDATA.STRINGS$[]
    LNS$[]=EXPLODE(DATA$,"q")
    var C&=SIZEOF(LNS$[])

    IF (C&=0)

        IF (LNS$[0]="")

            RETURN LNS$[]

        ENDIF

    ENDIF

    DATA$=""

    WHILELOOP 0,C&-1

        IFNOT (&LOOP MOD 2)

            DATA$=DATA$+LNS$[&LOOP]

        ELSE

            MYDATA.STRINGS$[SIZEOF(MYDATA.STRINGS$[])]=LNS$[&LOOP]
            DATA$=DATA$+"q"+STR$(INT(SIZEOF(MYDATA.STRINGS$[])))+"q"

        ENDIF

    ENDWHILE

    DECLARE NDATA$[]
    NDATA$[]=EXPLODE(DATA$,"
    ")
    RETURN NDATA$[]

endproc

proc MYDATA.GETXY

    PARAMETERS X&,Y&
    DEC Y&
    var s$=SUBSTR$(MYDATA$[Y&],X&,",")

    IFNOT MID$(s$,1,1)="q"

        RETURN s$

    ENDIF

    var N&=VAL(DEL$(s$,1,1))

    IFNOT N&

        RETURN ""

    ENDIF

    RETURN MYDATA.STRINGS$[N&-1]

endproc

proc FGC

    PARAMETERS FLE$
    var FH&=ASSIGN(FLE$)

    IFNOT FH&

        RETURN ""

    ENDIF

    RESET #FH&
    var s$=""
    var _OUT$=""

    WHILENOT EOF(FH&)

        INPUT #FH&,s$
        _OUT$=_OUT$+s$

        IFNOT EOF(FH&)

            _OUT$=_OUT$+"
            "

        ENDIF

    ENDWHILE

    CLOSE FH&
    ASSIGN FH&,""
    RETURN _OUT$

endproc

 
12/08/08  
 




Matthias
Badzun
Vielen Thanks you all for different ideas. so far I The with my yet right bescheidenen XProfan-Kenntnissen understand could Have I tappt im dunkeln ausprobiert.
there into Textfeldern Kommata vorkommen goes substr$ not - the mach then there one new area on and moreover hinten stehende then not any more red. means had I still The row first of all complete reading and then byte for byte auspicken. Irgendwas hakt of course yet sometimes at again-zusammenbau the Texts in a new String, must with the Feldinhalt concern, but at least Have I already time any my boxes again in individual Variabelen.

glad Festtage and good Slip for all

Matthias
 
Gruß,
Matthias
12/19/08  
 



In my Posting (2 high) stand two working (tested) Solutions, like not?

(naja, heavy To overlooking ists Yes not there einziger code here in the Thread *g*)

On german: The code shows still as working and is additionally very quick.
 
12/19/08  
 




Matthias
Badzun
like tät I The already, but since reicht my profanes XProfan-know yet long not from around the To understand. If then in the practice what aneckt Have I no chance, The causes To discover.
so integrally gradually stoße I here on The Equivalente to that Altgelernten. but a couple Progrämmle must I me well yet rausquälen circa again fit To go.
nevertheless many Thanks for these Scripte, are on the disk, but not yet in the Hirn see you soon, until next Hose, on the I a while ausharre
 
Gruß,
Matthias
12/19/08  
 



You are welcome!

If ask come into being...

but Perhaps could yes a Geübter obigen code something humanisieren.
 
12/19/08  
 



Answer


Topictitle, max. 100 characters.
 

Systemprofile:

no Systemprofil laid out. [anlegen]

XProfan:

 Posting  Font  Smilies  ▼ 

Please register circa a Posting To verfassen.
 

Topic-Options

1.813 Views

Untitledvor 0 min.
Peter Max Müller09/30/14
Georg Hovenbitzer10/02/13
Michaeal10/18/12
iF03/05/11

Themeninformationen



Admins  |  AGB  |  Applications  |  Authors  |  Chat  |  Privacy Policy  |  Download  |  Entrance  |  Help  |  Merchantportal  |  Imprint  |  Mart  |  Interfaces  |  SDK  |  Services  |  Games  |  Search  |  Support

One proposition all XProfan, The there's!


My XProfan
Private Messages
Own Storage Forum
Topics-Remember-List
Own Posts
Own Topics
Clipboard
Log off
 Deutsch English Français Español Italia
Translations

Privacy Policy


we use Cookies only as Session-Cookies because of the technical necessity and with us there no Cookies of Drittanbietern.

If you here on our Website click or navigate, stimmst You ours registration of Information in our Cookies on XProfan.Net To.

further Information To our Cookies and moreover, How You The control above keep, find You in ours nachfolgenden Datenschutzerklärung.


all rightDatenschutzerklärung
i want none Cookie