English
Forum

reading more numerischer values per Line of/ one Textdatei

 

rafl
Hi,

I have a Textdatei, in the stand per row two Integerwerte and three Floatwerte through space separated.

Bsp.: 1234 345 123.456 567.234 789.456

can I The values by a input # -commands reading (How in middle-aged BASIC-Dialekten) Bsp. input #1, a%,b%,c!,d!,e! or must I The row as String reading and subsequently with val(mid$...) or. val(substr$(...) ) again zerpflücken?

Rafl
 
05/02/16  
 




Jörg
Sellmeyer
Hm - something like can still by a short Selbstversuch integrally quick find out, or?

You can The row through Explode then quick into Stringarray get and have so good grabbed hereon. If you single variables benötigst, becomes you but nothing other remain, as whom String To decompose, or The values from the aray To fetch and the variables zuzuweisen.
 
XProfan X3
Windows XP SP2 XProfan X4
... und hier mal was ganz anderes als Profan ...
05/02/16  
 




rafl
I have indeed already experimented, having but the hope, something overlooking to have and that it still a einfachere Solution gives, without whom detour a String and anschließender Typumwandlung.
 
05/02/16  
 




Jörg
Sellmeyer
Sooo demented umwegig is the then but neither:
Declare a$[]
Declare a%,b%,c!,d!,e!
Var s$ = "1234 345 123.456 567.234 789.456"
'here would then about:
'Input #1, s$
a$[] = Explode(s$," ")
a% = a$[0]
' if You on number sure weg want, take You here each Val() moreover
b% =Val( a$[1])
c! = a$[2]
d! = a$[3]
e! = a$[4]
Print a%,b%,c!,d!,e!
Print

WhileLoop 0,SizeOf(a$[]) - 1

    print a$[&Loop]

Wend

WaitInput
 
Windows XP SP2 XProfan X4
... und hier mal was ganz anderes als Profan ...
05/02/16  
 




rafl
OK. thanks for speedy Help.
 
05/02/16  
 



Answer


Topictitle, max. 100 characters.
 

Systemprofile:

no Systemprofil laid out. [anlegen]

XProfan:

 Posting  Font  Smilies  ▼ 

Please register circa a Posting To verfassen.
 

Topic-Options

7.870 Views

Untitledvor 0 min.
ecki04/01/19
rafl02/17/19
Samy01/12/18
Martin Kempf11/28/16
More...

Themeninformationen

this Topic has 2 subscriber:

rafl (3x)
Jörg Sellmeyer (2x)


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