Question
Aide pour lecture fichier texte
- boutou
- Auteur du sujet
- Hors Ligne
- Membre junior
-
Réduire
Plus d'informations
- Messages : 36
- Remerciements reçus 0
il y a 8 ans 10 mois #23678
par boutou
Réponse de boutou sur le sujet Re:Aide pour lecture fichier texte
Ah oui ok,
Ca marche mieux en effet mais ca boucle :
ERROR: [ : Cannot index into a null array.
ERROR:
currencynew.ps1 (150): ERROR: At Line: 150 char: 10
ERROR: + $array[ <<<< 0]
ERROR: + CategoryInfo : InvalidOperation: (0:Int32) [], RuntimeException
ERROR: + FullyQualifiedErrorId : NullArray
ERROR:<br><br>Message édité par: boutou, à: 18/05/17 16:39
Ca marche mieux en effet mais ca boucle :
ERROR: [ : Cannot index into a null array.
ERROR:
currencynew.ps1 (150): ERROR: At Line: 150 char: 10
ERROR: + $array[ <<<< 0]
ERROR: + CategoryInfo : InvalidOperation: (0:Int32) [], RuntimeException
ERROR: + FullyQualifiedErrorId : NullArray
ERROR:<br><br>Message édité par: boutou, à: 18/05/17 16:39
Connexion ou Créer un compte pour participer à la conversation.
- Laurent Dardenne
- Hors Ligne
- Modérateur
-
Réduire
Plus d'informations
- Messages : 6311
- Remerciements reçus 68
il y a 8 ans 10 mois #23679
par Laurent Dardenne
Tutoriels PowerShell
Réponse de Laurent Dardenne sur le sujet Re:Aide pour lecture fichier texte
Si tu ne crées plus le tableau de démo, supprime la ligne $array[0]...
Tutoriels PowerShell
Connexion ou Créer un compte pour participer à la conversation.
- boutou
- Auteur du sujet
- Hors Ligne
- Membre junior
-
Réduire
Plus d'informations
- Messages : 36
- Remerciements reçus 0
il y a 8 ans 10 mois #23680
par boutou
Réponse de boutou sur le sujet Re:Aide pour lecture fichier texte
ok mais ça boucle tjrs !
rint<br><br>Message édité par: boutou, à: 18/05/17 18:35Chiffre2 Chiffre1 Tri Infos
---
134.66157359 0.0074260234 ALL Albanian Leke
121.64821374 0.0082204249 DZD Algerian Dinars
17.398922481 0.0574748236 ARS Argentine Pesos
1.5017489230 0.6658902728 AUD Australian Dollars
1.1147824781 0.8970359865 BSD Bahamian Dollars
0.4203518982 2.3789591631 BHD Bahraini Dinars
89.875144786 0.0111265467 BDT Bangladeshi Taka
2.2295649563 0.4485179933 BBD Barbadian or Bajan Dollars
1.1147824781 0.8970359865 BMD Bermudian Dollars
7.7062880589 0.1297641604 BOB Bolivian Bolivianos
1.9558300000 0.5112918812 BAM Bosnian Convertible Marka
11.513222041 0.0868566589 BWP Botswana Pula
3.4821809301 0.2871763473 BRL Brazilian Real
0.8603219364 1.1623555761 GBP British Pounds
1.9565586197 0.5111014768 BGN Bulgarian Leva
655.95700000 0.0015244902 XOF CFA Francs
119.33174224 0.0083800000 XPF CFP Francs
1.5191467494 0.6582642529 CAD Canadian Dollars
655.95700000 0.0015244902 XAF Central African Francs
746.33765770 0.0013398761 CLP Chilean Pesos
7.6782171260 0.1302385676 CNY Chinese Yuan Renminbi
3229.8889888 0.0003096082 COP Colombian Pesos
637.82050944 0.0015678392 CRC Costa Rican Colones
7.4377546970 0.1344491773 HRK Croatian Kuna
29.541735670 0.0338504146 CUP Cuban Pesos
26.494060290 0.0377443091 CZK Czech Koruny
7.4392720180 0.1344217549 DKK Danish Kroner
52.816225491 0.0189335756 DOP Dominican Pesos
3.0099198355 0.3322347619 XCD East Caribbean Dollars
20.154727742 0.0496161503 EGP Egyptian Pounds
4.0944550451 0.2442327462 AED Emirati Dirhams
1.0000000000 1.0000000000 EUR Euros
2.3303848117 0.4291136790 FJD Fijian Dollars
0.0008866796 1127.8031120 XAU Gold Ounces
8.1778680723 0.1222812585 GTQ Guatemalan Quetzales
8.6800366450 0.1152068869 HKD Hong Kong Dollars
309.07516533 0.0032354589 HUF Hungarian Forint
0.8078092067 1.2379160720 XDR IMF Special Drawing Rights
112.89051529 0.0088581401 ISK Icelandic Kronur
71.640769492 0.0139585324 INR Indian Rupees
14852.076965 0.0000673307 IDR Indonesian Rupiahs
36171.548129 0.0000276460 IRR Iranian Rials
1302.4907088 0.0007677598 IQD Iraqi Dinars
4.0258577234 0.2483942724 ILS Israeli New Shekels
144.43223842 0.0069236620 JMD Jamaican Dollars
123.86419757 0.0080733579 JPY Japanese Yen
0.7905172070 1.2649946025 JOD Jordanian Dinars
115.18326445 0.0086818168 KES Kenyan Shillings
0.3387791487 2.9517755260 KWD Kuwaiti Dinars
1684.6346338 0.0005936005 LBP Lebanese Pounds
4.8193818949 0.2074954884 MYR Malaysian Ringgits
38.804215961 0.0257703957 MUR Mauritian Rupees
20.834176434 0.0479980576 MXN Mexican Pesos
10.907932035 0.0916764055 MAD Moroccan Dirhams
1.6074861186 0.6220893533 NZD New Zealand Dollars
351.21948282 0.0028472225 NGN Nigerian Nairas
9.3806700597 0.1066021930 NOK Norwegian Kroner
0.4290659441 2.3306440743 OMR Omani Rials
116.87036444 0.0085564891 PKR Pakistani Rupees
6199.9239431 0.0001612923 PYG Paraguayan Guarani
3.6489195152 0.2740537290 PEN Peruvian Soles
55.460542777 0.0180308369 PHP Philippine Pesos
0.0011779401 848.93956985 XPT Platinum Ounces
4.1932855137 0.2384764874 PLN Polish Zlotych
4.0594209964 0.2463405498 QAR Qatari Rials
4.5657142573 0.2190237811 RON Romanian Lei
63.572308541 0.0157301193 RUB Russian Rubles
4.1806135327 0.2391993405 SAR Saudi Arabian Riyals
0.0659160351 15.170815387 XAG Silver Ounces
1.5506852520 0.6448761918 SGD Singapore Dollars
14.716475552 0.0679510523 ZAR South African Rand
1249.1206793 0.0008005632 KRW South Korean Won
170.21609750 0.0058748850 LKR Sri Lankan Rupees
9.7449456543 0.1026172988 SEK Swedish Kronor
1.0918018374 0.9159171250 CHF Swiss Francs
33.660719218 0.0297082185 TWD Taiwan New Dollars
38.428907888 0.0260220770 THB Thai Baht
7.5271720233 0.1328520189 TTD Trinidadian Dollars
2.6812087690 0.3729661083 TND Tunisian Dinars
3.9795087380 0.2512872985 TRY Turkish Lira
1.1147824781 0.8970359865 USD US Dollars
29.446417233 0.0339599888 UAH Ukrainian Hryvni
31.290880930 0.0319581926 UYU Uruguayan Pesos
25286.477425 0.0000395468 VND Vietnamese Dong
10.251423400 0.0975474294 ZMW Zambian Kwacha
134.66157359 0.0074260234 ALL Albanian Leke
121.64821374 0.0082204249 DZD Algerian Dinars
17.398922481 0.0574748236 ARS Argentine Pesos
1.5017489230 0.6658902728 AUD Australian Dollars
1.1147824781 0.8970359865 BSD Bahamian Dollars
0.4203518982 2.3789591631 BHD Bahraini Dinars
89.875144786 0.0111265467 BDT Bangladeshi Taka
2.2295649563 0.4485179933 BBD Barbadian or Bajan Dollars
1.1147824781 0.8970359865 BMD Bermudian Dollars
7.7062880589 0.1297641604 BOB Bolivian Bolivianos
1.9558300000 0.5112918812 BAM Bosnian Convertible Marka
11.513222041 0.0868566589 BWP Botswana Pula
3.4821809301 0.2871763473 BRL Brazilian Real
0.8603219364 1.1623555761 GBP British Pounds
1.9565586197 0.5111014768 BGN Bulgarian Leva
655.95700000 0.0015244902 XOF CFA Francs
119.33174224 0.0083800000 XPF CFP Francs
1.5191467494 0.6582642529 CAD Canadian Dollars
655.95700000 0.0015244902 XAF Central African Francs
746.33765770 0.0013398761 CLP Chilean Pesos
7.6782171260 0.1302385676 CNY Chinese Yuan Renminbi
3229.8889888 0.0003096082 COP Colombian Pesos
637.82050944 0.0015678392 CRC Costa Rican Colones
7.4377546970 0.1344491773 HRK Croatian Kuna
29.541735670 0.0338504146 CUP Cuban Pesos
26.494060290 0.0377443091 CZK Czech Koruny
7.4392720180 0.1344217549 DKK Danish Kroner
52.816225491 0.0189335756 DOP Dominican Pesos
3.0099198355 0.3322347619 XCD East Caribbean Dollars
20.154727742 0.0496161503 EGP Egyptian Pounds
4.0944550451 0.2442327462 AED Emirati Dirhams
1.0000000000 1.0000000000 EUR Euros
2.3303848117 0.4291136790 FJD Fijian Dollars
0.0008866796 1127.8031120 XAU Gold Ounces
8.1778680723 0.1222812585 GTQ Guatemalan Quetzales
8.6800366450 0.1152068869 HKD Hong Kong Dollars
309.07516533 0.0032354589 HUF Hungarian Forint
0.8078092067 1.2379160720 XDR IMF Special Drawing Rights
112.89051529 0.0088581401 ISK Icelandic Kronur
71.640769492 0.0139585324 INR Indian Rupees
14852.076965 0.0000673307 IDR Indonesian Rupiahs
36171.548129 0.0000276460 IRR Iranian Rials
1302.4907088 0.0007677598 IQD Iraqi Dinars
4.0258577234 0.2483942724 ILS Israeli New Shekels
144.43223842 0.0069236620 JMD Jamaican Dollars
123.86419757 0.0080733579 JPY Japanese Yen
0.7905172070 1.2649946025 JOD Jordanian Dinars
115.18326445 0.0086818168 KES Kenyan Shillings
0.3387791487 2.9517755260 KWD Kuwaiti Dinars
1684.6346338 0.0005936005 LBP Lebanese Pounds
4.8193818949 0.2074954884 MYR Malaysian Ringgits
38.804215961 0.0257703957 MUR Mauritian Rupees
20.834176434 0.0479980576 MXN Mexican Pesos
10.907932035 0.0916764055 MAD Moroccan Dirhams
1.6074861186 0.6220893533 NZD New Zealand Dollars
351.21948282 0.0028472225 NGN Nigerian Nairas
9.3806700597 0.1066021930 NOK Norwegian Kroner
0.4290659441 2.3306440743 OMR Omani Rials
116.87036444 0.0085564891 PKR Pakistani Rupees
6199.9239431 0.0001612923 PYG Paraguayan Guarani
3.6489195152 0.2740537290 PEN Peruvian Soles
55.460542777 0.0180308369 PHP Philippine Pesos
0.0011779401 848.93956985 XPT Platinum Ounces
4.1932855137 0.2384764874 PLN Polish Zlotych
4.0594209964 0.2463405498 QAR Qatari Rials
4.5657142573 0.2190237811 RON Romanian Lei
63.572308541 0.0157301193 RUB Russian Rubles
4.1806135327 0.2391993405 SAR Saudi Arabian Riyals
0.0659160351 15.170815387 XAG Silver Ounces
1.5506852520 0.6448761918 SGD Singapore Dollars
14.716475552 0.0679510523 ZAR South African Rand
1249.1206793 0.0008005632 KRW South Korean Won
170.21609750 0.0058748850 LKR Sri Lankan Rupees
9.7449456543 0.1026172988 SEK Swedish Kronor
1.0918018374 0.9159171250 CHF Swiss Francs
33.660719218 0.0297082185 TWD Taiwan New Dollars
38.428907888 0.0260220770 THB Thai Baht
7.5271720233 0.1328520189 TTD Trinidadian Dollars
2.6812087690 0.3729661083 TND Tunisian Dinars
3.9795087380 0.2512872985 TRY Turkish Lira
1.1147824781 0.8970359865 USD US Dollars
29.446417233 0.0339599888 UAH Ukrainian Hryvni
31.290880930 0.0319581926 UYU Uruguayan Pesos
25286.477425 0.0000395468 VND Vietnamese Dong
10.251423400 0.0975474294 ZMW Zambian Kwacha
134.66157359 0.0074260234 ALL Albanian Leke
121.64821374 0.0082204249 DZD Algerian Dinars
17.398922481 0.0574748236 ARS Argentine Pesos
1.5017489230 0.6658902728 AUD Australian Dollars
1.1147824781 0.8970359865 BSD Bahamian Dollars
0.4203518982 2.3789591631 BHD Bahraini Dinars
89.875144786 0.0111265467 BDT Bangladeshi Taka
2.2295649563 0.4485179933 BBD Barbadian or Bajan Dollars
1.1147824781 0.8970359865 BMD Bermudian Dollars
7.7062880589 0.1297641604 BOB Bolivian Bolivianos
1.9558300000 0.5112918812 BAM Bosnian Convertible Marka
11.513222041 0.0868566589 BWP Botswana Pula
3.4821809301 0.2871763473 BRL Brazilian Real
0.8603219364 1.1623555761 GBP British Pounds
1.9565586197 0.5111014768 BGN Bulgarian Leva
655.95700000 0.0015244902 XOF CFA Francs
119.33174224 0.0083800000 XPF CFP Francs
1.5191467494 0.6582642529 CAD Canadian Dollars
655.95700000 0.0015244902 XAF Central African Francs
746.33765770 0.0013398761 CLP Chilean Pesos
7.6782171260 0.1302385676 CNY Chinese Yuan Renminbi
3229.8889888 0.0003096082 COP Colombian Pesos
637.82050944 0.0015678392 CRC Costa Rican Colones
7.4377546970 0.1344491773 HRK Croatian Kuna
29.541735670 0.0338504146 CUP Cuban Pesos
26.494060290 0.0377443091 CZK Czech Koruny
7.4392720180 0.1344217549 DKK Danish Kroner
52.816225491 0.0189335756 DOP Dominican Pesos
3.0099198355 0.3322347619 XCD East Caribbean Dollars
20.154727742 0.0496161503 EGP Egyptian Pounds
4.0944550451 0.2442327462 AED Emirati Dirhams
1.0000000000 1.0000000000 EUR Euros
2.3303848117 0.4291136790 FJD Fijian Dollars
0.0008866796 1127.8031120 XAU Gold Ounces
8.1778680723 0.1222812585 GTQ Guatemalan Quetzales
8.6800366450 0.1152068869 HKD Hong Kong Dollars
309.07516533 0.0032354589 HUF Hungarian Fo
Connexion ou Créer un compte pour participer à la conversation.
- boutou
- Auteur du sujet
- Hors Ligne
- Membre junior
-
Réduire
Plus d'informations
- Messages : 36
- Remerciements reçus 0
il y a 8 ans 10 mois #23681
par boutou
Réponse de boutou sur le sujet Re:Aide pour lecture fichier texte
Sacré défi que je t'ai lancé là
Connexion ou Créer un compte pour participer à la conversation.
- Laurent Dardenne
- Hors Ligne
- Modérateur
-
Réduire
Plus d'informations
- Messages : 6311
- Remerciements reçus 68
il y a 8 ans 10 mois #23682
par Laurent Dardenne
Tutoriels PowerShell
Réponse de Laurent Dardenne sur le sujet Re:Aide pour lecture fichier texte
boutou écrit:
Le code proposé ne boucle pas, ormis le parcours du fichier, c'est l'intégration dans ton code existant qui pose pb. (condition de la boucle While ? )
Pour faciliter le debug place 2 ou 3 lignes dans le fichier à traiter.
Tu peux aussi découper ton traitement en fonctions qui aideraient au debug
Je n'ai pas le temps de débuger ton script, ajoute des write-debug ou trace le avec le debugger de VSCode.Sacré défi que je t'ai lancé là
Le code proposé ne boucle pas, ormis le parcours du fichier, c'est l'intégration dans ton code existant qui pose pb. (condition de la boucle While ? )
Pour faciliter le debug place 2 ou 3 lignes dans le fichier à traiter.
Tu peux aussi découper ton traitement en fonctions qui aideraient au debug
Tutoriels PowerShell
Connexion ou Créer un compte pour participer à la conversation.
- boutou
- Auteur du sujet
- Hors Ligne
- Membre junior
-
Réduire
Plus d'informations
- Messages : 36
- Remerciements reçus 0
il y a 8 ans 10 mois #23683
par boutou
Réponse de boutou sur le sujet Re:Aide pour lecture fichier texte
Ok merci bcp en tous cas pour ton aide !
Connexion ou Créer un compte pour participer à la conversation.
Temps de génération de la page : 0.117 secondes
- Vous êtes ici :
-
Accueil
-
forum
-
PowerShell
-
Entraide pour les débutants
- Aide pour lecture fichier texte