IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

Java Discussion :

Mettre à jour un Google SpreadSheet avec un fichier CSV local sur mon ordinateur


Sujet :

Java

  1. #1
    Membre à l'essai
    Femme Profil pro
    Étudiant
    Inscrit en
    Octobre 2014
    Messages
    19
    Détails du profil
    Informations personnelles :
    Sexe : Femme
    Localisation : France, Paris (Île de France)

    Informations professionnelles :
    Activité : Étudiant
    Secteur : Enseignement

    Informations forums :
    Inscription : Octobre 2014
    Messages : 19
    Points : 19
    Points
    19
    Par défaut Mettre à jour un Google SpreadSheet avec un fichier CSV local sur mon ordinateur
    bonjour,
    Je souhaite effectuer un travail d'automatisation mensuelle d'un google spread sheet avec un fichier que j'obtiens tout les mois sur un dossier local de mon ordinateur. Je ne sais pas du tout comment commencer, je n'ai pas très bien compris si c'est une application web ou installée, ni comment m'authentifier ou encore comment implémenter une classe qui ecris le csv dans spreadsheet.

    Si vous pouvez m'aider ce serait un vrai soulagement.

    Merci par avance,

  2. #2
    Modérateur
    Avatar de wax78
    Homme Profil pro
    Chef programmeur
    Inscrit en
    Août 2006
    Messages
    4 073
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 43
    Localisation : Belgique

    Informations professionnelles :
    Activité : Chef programmeur
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Août 2006
    Messages : 4 073
    Points : 7 978
    Points
    7 978
    Par défaut
    Peut être trouvera tu ton bonheur ici : https://developers.google.com/google-apps/spreadsheets/
    (Les "ça ne marche pas", même écrits sans faute(s), vous porteront discrédit ad vitam æternam et malheur pendant 7 ans)

    N'oubliez pas de consulter les FAQ Java et les cours et tutoriels Java

  3. #3
    Membre à l'essai
    Femme Profil pro
    Étudiant
    Inscrit en
    Octobre 2014
    Messages
    19
    Détails du profil
    Informations personnelles :
    Sexe : Femme
    Localisation : France, Paris (Île de France)

    Informations professionnelles :
    Activité : Étudiant
    Secteur : Enseignement

    Informations forums :
    Inscription : Octobre 2014
    Messages : 19
    Points : 19
    Points
    19
    Par défaut doc google
    Merci, mais j'ai déjà consulté la documentation en long en large et en travers depuis 2 semaines et mes aptitudes minimes ne me permettent pas d'appréhender sans doute le lien entre les articles... je veux d'abord connaitre la définition du type (mots clés à chercher) d'application que je devrais créer pour faire mon travail avant de faire des recherches... est ce une application web? est-ce une application installée? quelles sont les contraintes et étapes à suivre ...
    De plus je me suis largement perdue dans la doc google: une fois on perle java, une fois javascript, une fois python...
    Je ne trouve pas vraiment cela transposable...

  4. #4
    Modérateur
    Avatar de wax78
    Homme Profil pro
    Chef programmeur
    Inscrit en
    Août 2006
    Messages
    4 073
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 43
    Localisation : Belgique

    Informations professionnelles :
    Activité : Chef programmeur
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Août 2006
    Messages : 4 073
    Points : 7 978
    Points
    7 978
    Par défaut
    Citation Envoyé par anaisf66 Voir le message
    je veux d'abord connaitre la définition du type (mots clés à chercher) d'application que je devrais créer pour faire mon travail avant de faire des recherches... est ce une application web? est-ce une application installée?
    ça on n'en sait rien du tout, ca depend du cahier de charge que tu as...

    Citation Envoyé par anaisf66 Voir le message
    De plus je me suis largement perdue dans la doc google: une fois on perle java, une fois javascript, une fois python...
    Je ne trouve pas vraiment cela transposable...
    Forcement il y'a plusieurs moyen "d'attaquer", en l'occurence tu poses ta question dans le forum java, donc la réponse est java.
    (Les "ça ne marche pas", même écrits sans faute(s), vous porteront discrédit ad vitam æternam et malheur pendant 7 ans)

    N'oubliez pas de consulter les FAQ Java et les cours et tutoriels Java

  5. #5
    Membre à l'essai
    Femme Profil pro
    Étudiant
    Inscrit en
    Octobre 2014
    Messages
    19
    Détails du profil
    Informations personnelles :
    Sexe : Femme
    Localisation : France, Paris (Île de France)

    Informations professionnelles :
    Activité : Étudiant
    Secteur : Enseignement

    Informations forums :
    Inscription : Octobre 2014
    Messages : 19
    Points : 19
    Points
    19
    Par défaut Pas de cahier des charge
    Bonjour,
    Je pense que je ne me suis pas super bien exprimée.
    Je ne sais que programmer et de manière très légère en Java donc je préfère faire en Java.
    j'arrive à lire mon fichier CSV en java mais je n'arrive pas à le mettre dans un objet correctement pour essayer ensuite de le mettre dans une boucle pour le mettre dans une feuille spécifique dans un google sheet spécifique... (je ne sais pas si c'est ca qu'il faut faire en java et je ne sais pas si j arriverais à me connecter avec le truc OAuth2 car j'ai essayé différents tuto et je n'y arrive toujours pas).
    Voici le code ou j'en suis:

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
    132
    133
    134
    135
    136
    137
    138
    139
    140
    141
    142
    143
    144
    145
    146
    147
    148
    149
    150
    151
    152
    153
    154
    155
    156
    157
    158
    159
    160
    161
    162
    163
    164
    165
    166
    167
    168
    169
    170
    171
    172
    173
    174
    175
    176
    177
    178
    179
    180
    181
    182
    183
    184
    185
    186
    187
    188
    189
    190
    191
    192
    193
    194
    195
    196
    197
    198
    199
    200
    201
    202
    203
    204
    205
    206
    207
    208
    209
    210
    211
    212
    213
    214
    215
    216
    217
    218
    219
    220
    221
    222
    223
    224
    225
    226
    227
    228
    229
    230
    231
    232
    233
    234
    235
    236
    237
    238
    239
    240
    241
    242
    243
    244
    245
    246
    247
    248
    249
    250
    251
    252
    253
    254
    255
    256
    257
    258
    259
    260
    261
    262
    263
    264
    265
    266
    267
    268
    269
    270
    271
    272
    273
    274
    275
    276
    277
    278
    279
    280
    281
    282
    283
    284
    285
    286
    287
    288
    289
    290
    291
    292
    293
    294
    295
    296
    297
    298
    299
    300
    301
    302
    303
    304
    305
    306
    307
    308
    309
    310
    311
    312
    313
    314
    315
    316
    317
    318
    319
    320
    321
    322
    323
    324
    325
    326
    327
    328
    329
    330
    331
    332
    333
    334
    335
    336
    337
    338
    339
    340
    341
    342
    343
    344
    345
    346
    347
    348
    349
    350
    351
    352
    353
    354
    355
    356
    357
    358
    359
    360
    361
    362
    363
    364
    365
    366
    367
    368
    369
    370
    371
    372
    373
    374
    375
    376
    377
    378
    379
    380
    381
    382
    383
    384
    385
    386
    387
    388
    389
    390
    391
    392
    393
    394
    395
    396
    397
    398
    399
    400
    401
    402
    403
    404
    405
    406
    407
    408
    409
    410
    411
    412
    413
    414
    415
    416
    417
    418
    419
    420
    421
    422
    423
    424
    425
    426
    427
    428
    429
    430
    431
    432
    433
    434
    435
    436
    437
    438
    439
    440
    441
    442
    443
    444
    445
    446
    447
    448
    449
    450
    451
    452
    453
    454
    455
    456
    457
    458
    459
    460
    461
    462
    463
    464
    465
    466
    467
    468
    469
    470
    471
    472
    473
    474
    475
    476
    477
    478
    479
    480
    481
    482
    483
    484
    485
    486
    487
    488
    489
    490
    491
    492
    493
    494
    495
    496
    497
    498
    499
    500
    501
    502
    503
    504
    505
    506
    507
    508
    509
    510
    511
    512
    513
    514
    515
    516
    517
    518
    519
    520
    521
    522
    523
    524
    525
    526
    527
    528
    529
    530
    531
    532
    533
    534
    535
    536
    537
    538
    539
    540
    541
    542
    543
    544
    545
    546
    547
    548
    549
    550
    551
    552
    553
    554
    555
    556
    557
    558
    559
    560
    561
    562
    563
    564
    565
    566
    567
    568
    569
    570
    571
    572
    573
    574
    575
    576
    577
    578
    579
    580
    581
    582
    583
    584
    585
    586
    587
    588
    589
    590
    591
    592
    593
    594
    595
    596
    597
    598
    599
    600
    601
    602
    603
    604
    605
    606
    607
    608
    609
    610
    611
    612
    613
    614
    615
    616
    617
    618
    619
    620
    621
    622
    623
    624
    625
    626
    627
    628
    629
    630
    631
    632
    633
    634
    635
    636
    637
    638
    639
    640
    641
    642
    643
    644
    645
    646
    647
    648
    649
    650
    651
    652
    653
    654
    655
    656
    657
    658
    659
    660
    661
    662
    663
    664
    665
    666
    667
    668
    669
    670
    671
    672
    673
    674
    675
    676
    677
    678
    679
    680
    681
    682
    683
    684
    685
    686
    687
    688
    689
    690
    691
    692
    693
    694
    695
    696
    697
    698
    699
    700
    701
    702
    703
    704
    705
    706
    707
    708
    709
    710
    711
    712
    713
    714
    715
    716
    /*class csv*/
    public class Csv {
    	public String group;
    	public String Year;
    	public String Month;
    	public String customers;
    	public String avgtxns;
    	public String sdtxns;
    	public String txns;
    	public String avgamnt;
    	public String amnt;
    	public String withbranch;
    	public String avgbranchtxns;
    	public String branchtxns;
    	public String avgbranchamnt;
    	public String branchamnt;
    	public String avgADCtxns;
    	public String ADCtxns;
    	public String avgADCamnt;
    	public String ADCamnt;
    	public String withcashin;
    	public String avgcashin;
    	public String cashin;
    	public String avgcashinamnt;
    	public String cashinamnt;
    	public String withcashout;
    	public String avgcashout;
    	public String cashout;
    	public String avgcashoutamnt;
    	public String cashoutamnt;
    	public String withtransfer;
    	public String avgtransfer;
    	public String transfer;
    	public String avgtransferamnt;
    	public String transferamnt;
    	public String withbranchcashin;
    	public String avgbranchcashin;
    	public String branchcashin;
    	public String avgbranchcashinamnt;
    	public String branchcashinamnt;
    	public String withbranchcashout;
    	public String avgbranchcashout;
    	public String branchcashout;
    	public String avgbranchcashoutamnt;
    	public String branchcashoutamnt;
    	public String withADCcashin;
    	public String avgADCcashin;
    	public String ADCcashin;
    	public String avgADCcashinamnt;
    	public String ADCcashinamnt;
    	public String withADCcashout;
    	public String avgADCcashout;
    	public String ADCcashout;
    	public String avgADCcashoutamnt;
    	public String ADCcashoutamnt;
    	public String withloans;
    	public String avgloanoutst;
    	public String loanoutst;
    	public String withsavings;
    	public String aversavingbal;
    	public String savingbal;
    	public String withcurrents;
    	public String avercurrentbal;
    	public String currentbal;
    	public String withtds;
    	public String avertdbal;
    	public String tdbal;
    	public String withttotalsavings;
    	public String avertotalbal;
    	public String totalbal;
     
    	public int getTotalbal;
    	public int getAvertotalbal;
    	public int getWithttotalsavings;
    	public int getYear;
    	public int getMonth;
    	public int getCustomers;
    	public int getAvgtxns;
    	public int getSdtxns;
    	public int getTxns;
    	public int getAvgamnt;
    	public int getAmnt;
    	public int getWithbranch;
    	public int getAvgbranchtxns;
    	public int getBranchtxns;
    	public int getAvgbranchamnt;
    	public int getBranchamnt;
    	public int getAvgADCtxns;
    	public int getADCtxns;
    	public int getAvgADCamnt;
    	public int getADCamnt;
    	public int getWithcashin;
    	public int getTdbal;
    	public int getAvertdbal;
    	public int getWithtds;
    	public int getCurrentbal;
    	public int getAvercurrentbal;
    	public int getWithcurrents;
    	public int getSavingbal;
    	public int getAversavingbal;
    	public int getWithsavings;
    	public int getLoanoutst;
    	public int getAvgloanoutst;
    	public int getWithloans;
    	public int getADCcashoutamnt;
    	public int getAvgADCcashoutamnt;
    	public int getADCcashout;
    	public int getAvgADCcashout;
    	public int getWithADCcashout;
    	public int getADCcashinamnt;
    	public int getADCcashin;
    	public int getAvgADCcashin;
    	public int getWithADCcashin;
    	public int getBranchcashoutamnt;
    	public int getBranchcashout;
    	public int getAvgbranchcashoutamnt;
    	public int getAvgbranchcashout;
    	public int getWithbranchcashout;
    	public int getBranchcashinamnt;
    	public int getAvgbranchcashinamnt;
    	public int getBranchcashin;
    	public int getAvgbranchcashin;
    	public int getWithbranchcashin;
    	public int getTransferamnt;
    	public int getAvgcashin;
    	public int getCashin;
    	public int getAvgcashinamnt;
    	public int getCashinamnt;
    	public int getAvgcashout;
    	public int getWithcashout;
    	public int getCashout;
    	public int getAvgcashoutamnt;
    	public int getCashoutamnt;
    	public int getWithtransfer;
    	public int getAvgtransfer;
    	public int getTransfer;
    	public int getAvgtransferamnt;
    	public int getAvgADCcashinamnt;
     
     
     
     
     
    	public String getGroup() {
    		return group;
    	}
     
    	public void setGroup(String group) {
    		this.group = group;
    	}
     
    	public String getYear() {
    		return Year;
    	}
     
    	public void setYear(String Year) {
    		this.Year = Year;
    	}
     
    	public String getMonth() {
    		return Month;
    	}
     
    	public void setMonth(String Month) {
    		this.Month = Month;
    	}
     
    	public String getCustomers() {
    		return customers;
    	}
     
    	public void setCustomers(String customers) {
    		this.customers = customers;
    	}
     
    	public String getAvgtxns() {
    		return avgtxns;
    	}
     
    	public void setAvgtxns(String avgtxns) {
    		this.avgtxns = avgtxns;
    	}
     
    	public String getSdtxns() {
    		return sdtxns;
    	}
     
    	public void setSdtxns(String sdtxns) {
    		this.sdtxns = sdtxns;
    	}
     
    	public String getTxns() {
    		return txns;
    	}
     
    	public void setTxns(String txns) {
    		this.txns = txns;
    	}
     
     
    	public String getAvgamnt() {
    		return avgamnt;
    	}
     
    	public void setAvgamnt(String avgamnt) {
    		this.avgamnt = avgamnt;
    	}
     
     
    	public String getAmnt() {
    		return amnt;
    	}
     
    	public void setAmnt(String amnt) {
    		this.amnt = amnt;
    	}
     
     
    	public String getWithbranch() {
    		return withbranch;
    	}
     
    	public void setWithbranch(String withbranch) {
    		this.withbranch =withbranch ;
    	}
     
     
    	public String getAvgbranchtxns() {
    		return avgbranchtxns;
    	}
     
    	public void setAvgbranchtxns(String avgbranchtxns) {
    		this.avgbranchtxns = avgbranchtxns;
    	}
     
     
     
    public String getBranchtxns() {
    		return branchtxns;
    	}
     
    	public void setBranchtxns(String branchtxns) {
    		this.branchtxns = branchtxns;
    	}
     
    	public String getAvgbranchamnt() {
    		return avgbranchamnt;
    	}
     
    	public void setAvgbranchamnt(String avgbranchamnt) {
    		this.avgbranchamnt = avgbranchamnt;
    	}
     
    	public String getBranchamnt() {
    		return branchamnt;
    	}
     
    	public void setBranchamnt(String branchamnt) {
    		this.branchamnt = branchamnt;
    	}
     
     
     
    	public String getAvgADCtxns() {
    		return avgADCtxns;
    	}
     
    	public void setAvgADCtxns(String avgADCtxns) {
    		this.avgADCtxns = avgADCtxns;
    	}
     
     
    		public String getADCtxns() {
    		return ADCtxns;
    	}
     
    	public void setADCtxns(String ADCtxns) {
    		this.ADCtxns = ADCtxns;
    	}
     
     
    	public String getAvgADCamnt() {
    		return avgADCamnt;
    	}
     
    	public void setAvgADCamnt(String avgADCamnt) {
    		this.avgADCamnt = avgADCamnt;
    	}
     
    	public String getADCamnt() {
    		return ADCamnt;
    	}
     
    	public void setADCamnt(String ADCamnt) {
    		this.ADCamnt = ADCamnt;
    	}
     
    	public String getWithcashin() {
    		return withcashin;
    	}
     
    	public void setWithcashin(String withcashin) {
    		this.withcashin = withcashin;
    	}
     
    	public String getAvgcashin() {
    		return avgcashin;
    	}
     
    	public void setAvgcashin(String avgcashin) {
    		this.avgcashin = avgcashin;
    	}
     
    	public String getCashin() {
    		return cashin;
    	}
     
    	public void setCashin(String cashin) {
    		this.cashin = cashin;
    	}
     
    	public String getAvgcashinamnt() {
    		return avgcashinamnt;
    	}
     
    	public void setAvgcashinamnt(String avgcashinamnt) {
    		this.avgcashinamnt = avgcashinamnt;
    	}
     
    	public String getCashinamnt() {
    		return cashinamnt;
    	}
     
    	public void setCashinamnt(String cashinamnt) {
    		this.cashinamnt = cashinamnt;
    	}
     
    	public String getWithcashout() {
    		return withcashout;
    	}
     
    	public void setWithcashout(String withcashout) {
    		this.withcashout = withcashout;
    	}
     
    	public String getAvgcashout() {
    		return avgcashout;
    	}
     
    	public void setAvgcashout(String avgcashout) {
    		this.avgcashout = avgcashout;
    	}
     
    	public String getCashout() {
    		return cashout;
    	}
     
    	public void setCashout(String cashout) {
    		this.cashout = cashout;
    	}
     
    	public String getAvgcashoutamnt() {
    		return avgcashoutamnt;
    	}
     
    	public void setAvgcashoutamnt(String avgcashoutamnt) {
    		this.avgcashoutamnt = avgcashoutamnt;
    	}
     
    	public String getCashoutamnt() {
    		return cashoutamnt;
    	}
     
    	public void setCashoutamnt(String cashoutamnt) {
    		this.cashoutamnt = cashoutamnt;
    	}
     
    	public String getWithtransfer() {
    		return withtransfer;
    	}
     
    	public void setWithtransfer(String withtransfer) {
    		this.withtransfer = withtransfer;
    	}
     
    	public String getAvgtransfer() {
    		return avgtransfer;
    	}
     
    	public void setAvgtransfer(String avgtransfer) {
    		this.avgtransfer = avgtransfer;
    	}
     
    	public String getTransfer() {
    		return transfer;
    	}
     
    	public void setTransfer(String transfer) {
    		this.transfer = transfer;
    	}
     
    	public String getAvgtransferamnt() {
    		return avgtransferamnt;
    	}
     
    	public void setAvgtransferamnt(String avgtransferamnt) {
    		this.avgtransferamnt = avgtransferamnt;
    	}
     
    	public String getTransferamnt() {
    		return transferamnt;
    	}
     
    	public void setTransferamnt(String transferamnt) {
    		this.transferamnt = transferamnt;
    	}
     
    	public String getWithbranchcashin() {
    		return withbranchcashin;
    	}
     
    	public void setWithbranchcashin(String withbranchcashin) {
    		this.withbranchcashin = withbranchcashin;
    	}
     
    	public String getAvgbranchcashin() {
    		return avgbranchcashin;
    	}
     
    	public void setAvgbranchcashin(String avgbranchcashin) {
    		this.avgbranchcashin = avgbranchcashin;
    	}
     
    	public String getBranchcashin() {
    		return branchcashin;
    	}
     
    	public void setBranchcashin(String branchcashin) {
    		this.branchcashin = branchcashin;
    	}
     
    	public String getAvgbranchcashinamnt() {
    		return avgbranchcashinamnt;
    	}
     
    	public void setAvgbranchcashinamnt(String avgbranchcashinamnt) {
    		this.avgbranchcashinamnt = avgbranchcashinamnt;
    	}
     
    	public String getBranchcashinamnt() {
    		return branchcashinamnt ;
    	}
     
    	public void setBranchcashinamnt(String branchcashinamnt) {
    		this.branchcashinamnt = branchcashinamnt;
    	}
     
     
    	public String getWithbranchcashout() {
    		return withbranchcashout;
    	}
     
    	public void setWithbranchcashout(String withbranchcashout) {
    		this.withbranchcashout = withbranchcashout;
    	}
     
    	public String getAvgbranchcashout() {
    		return avgbranchcashout;
    	}
     
    	public void setAvgbranchcashout(String avgbranchcashout) {
    		this.avgbranchcashout = avgbranchcashout;
    	}
     
    	public String getBranchcashout() {
    		return branchcashout;
    	}
     
    	public void setBranchcashout(String branchcashout) {
    		this.branchcashout = branchcashout;
    	}
     
    	public String getAvgbranchcashoutamnt() {
    		return avgbranchcashoutamnt;
    	}
     
    	public void setAvgbranchcashoutamnt(String avgbranchcashoutamnt) {
    		this.avgbranchcashoutamnt = avgbranchcashoutamnt;
    	}
     
    	public String getBranchcashoutamnt() {
    		return branchcashoutamnt;
    	}
     
    	public void setBranchcashoutamnt(String branchcashoutamnt) {
    		this.branchcashoutamnt = branchcashoutamnt;
    	}
     
    	public String getWithADCcashin() {
    		return withADCcashin;
    	}
     
    	public void setWithADCcashin(String withADCcashin) {
    		this.withADCcashin = withADCcashin;
    	}
     
    	public String getAvgADCcashin() {
    		return avgADCcashin;
    	}
     
    	public void setAvgADCcashin(String avgADCcashin) {
    		this.avgADCcashin = avgADCcashin;
    	}
     
    	public String getADCcashin() {
    		return ADCcashin;
    	}
     
    	public void setADCcashin(String ADCcashin) {
    		this.ADCcashin = ADCcashin;
    	}
     
    	public String getAvgADCcashinamnt() {
    		return avgADCcashinamnt;
    	}
     
    	public void setAvgADCcashinamnt(String avgADCcashinamnt) {
    		this.avgADCcashinamnt = avgADCcashinamnt;
    	}
     
    	public String getADCcashinamnt() {
    		return ADCcashinamnt;
    	}
     
    	public void setADCcashinamnt(String ADCcashinamnt) {
    		this.ADCcashinamnt = ADCcashinamnt;
    	}
     
    		public String getWithADCcashout() {
    		return withADCcashout;
    	}
     
    	public void setWithADCcashout(String withADCcashout) {
    		this.withADCcashout = withADCcashout;
    	}
     
    		public String getAvgADCcashout() {
    		return avgADCcashout;
    	}
     
    	public void setAvgADCcashout(String avgADCcashout) {
    		this.avgADCcashout = avgADCcashout;
    	}
     
    		public String getADCcashout() {
    		return ADCcashout;
    	}
     
    	public void setADCcashout(String ADCcashout) {
    		this.ADCcashout = ADCcashout;
    	}
     
     
    		public String getAvgADCcashoutamnt() {
    		return avgADCcashoutamnt;
    	}
     
    	public void setAvgADCcashoutamnt(String avgADCcashoutamnt) {
    		this.avgADCcashoutamnt = avgADCcashoutamnt;
    	}
     
     
    		public String getADCcashoutamnt() {
    		return ADCcashoutamnt;
    	}
     
    	public void setADCcashoutamnt(String ADCcashoutamnt) {
    		this.ADCcashoutamnt = ADCcashoutamnt;
    	}
     
    		public String getWithloans() {
    		return withloans;
    	}
     
    	public void setWithloans(String withloans) {
    		this.withloans = withloans;
    	}
     
     
    		public String getAvgloanoutst() {
    		return avgloanoutst;
    	}
     
    	public void setAvgloanoutst(String avgloanoutst) {
    		this.avgloanoutst = avgloanoutst;
    	}
     
     
    		public String getLoanoutst() {
    		return loanoutst;
    	}
     
    	public void setLoanoutst(String loanoutst) {
    		this.loanoutst = loanoutst;
    	}
     
     
    		public String getWithsavings() {
    		return withsavings;
    	}
     
    	public void setWithsavings(String withsavings) {
    		this.withsavings = withsavings;
    	}
     
     
    		public String getAversavingbal() {
    		return aversavingbal;
    	}
     
    	public void setAversavingbal(String aversavingbal) {
    		this.aversavingbal = aversavingbal;
    	}
     
     
    		public String getSavingbal() {
    		return savingbal;
    	}
     
    	public void setSavingbal(String savingbal) {
    		this.savingbal = savingbal;
    	}
     
     
    		public String getWithcurrents() {
    		return withcurrents;
    	}
     
    	public void setWithcurrents(String withcurrents) {
    		this.withcurrents = withcurrents;
    	}
     
     
    		public String getAvercurrentbal() {
    		return avercurrentbal;
    	}
     
    	public void setAvercurrentbal(String avercurrentbal) {
    		this.avercurrentbal = avercurrentbal;
    	}
     
     
    		public String getCurrentbal() {
    		return currentbal;
    	}
     
    	public void setCurrentbal(String currentbal) {
    		this.currentbal = currentbal;
    	}
     
     
    		public String getWithtds() {
    		return withtds;
    	}
     
    	public void setWithtds(String withtds) {
    		this.withtds = withtds;
    	}
     
     
    		public String getAvertdbal() {
    		return avertdbal;
    	}
     
    	public void setAvertdbal(String avertdbal) {
    		this.avertdbal = avertdbal;
    	}
     
     
    		public String getTdbal() {
    		return tdbal;
    	}
     
    	public void setTdbal(String tdbal) {
    		this.tdbal = tdbal;
    	}
     
     
    		public String getWithttotalsavings() {
    		return withttotalsavings;
    	}
     
    	public void setWithttotalsavings(String withttotalsavings) {
    		this.withttotalsavings = withttotalsavings;
    	}
     
     
    		public String getAvertotalbal() {
    		return avertotalbal;
    	}
     
    	public void setAvertotalbal(String avertotalbal) {
    		this.avertotalbal = avertotalbal;
    	}
     
     
    		public String getTotalbal() {
    		return totalbal;
    	}
     
    	public void setTotalbal(String totalbal) {
    		this.totalbal = totalbal;
    	}
     
     
    }
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    /*class read*/
    import java.io.BufferedReader;
    import java.io.FileNotFoundException;
    import java.io.FileReader;
    import java.io.IOException;
     
    /**
     * @author 
     * 
     */
    public class ReadCsv {
    	public void readCsv() {
    		String csvFileToRead = "C:\\Users\\anaisf\\Desktop\\test.csv";
    		BufferedReader br = null;
    		String line = "";
    		String splitBy = ",";
     
    		try {
     
    			br = new BufferedReader(new FileReader(csvFileToRead));
    			while ((line = br.readLine()) != null) {
     
    				String[] Csv = line.split(splitBy);
    				System.out.println(
    						                  Csv[0]     
    	                     		 + "," +  Csv[1]
    	        					 + "," +  Csv[2]
    	        					 + "," +  Csv[3]
    	        					 + "," +  Csv[4]
    	        					 + "," +  Csv[5]
    	        					 + "," +  Csv[6]
    	        					 + "," +  Csv[7]
    	        					 + "," +  Csv[8]
    	        					 + "," +  Csv[9]
    	        					 + "," +  Csv[10]
    	        					 + "," +  Csv[11]
    	        					 + "," +  Csv[12]
    	        					 + "," +  Csv[13]
    	        					 + "," +  Csv[14]
    	        					 + "," +  Csv[15] 
    	        					 + "," +  Csv[16] 
    	        					 + "," +  Csv[17] 
    	        					 + "," +  Csv[18] 
    	        					 + "," +  Csv[19] 
    	        					 + "," +  Csv[20] 
    	        					 + "," +  Csv[21] 
    	        					 + "," +  Csv[22] 
    	        					 + "," +  Csv[23] 
    	        					 + "," +  Csv[24] 
    	        					 + "," +  Csv[25] 
    	        					 + "," +  Csv[26] 
    	        					 + "," +  Csv[27] 
    	        					 + "," +  Csv[28] 
    	        					 + "," +  Csv[29] 
    	        					 + "," +  Csv[30] 
    	        					 + "," +  Csv[31] 
    	        					 + "," +  Csv[32] 
    	        					 + "," +  Csv[33] 
    	        					 + "," +  Csv[34] 
    	        					 + "," +  Csv[35] 
    	        					 + "," +  Csv[36] 
    	        					 + "," +  Csv[37] 
    	        					 + "," +  Csv[38] 
    	        					 + "," +  Csv[39] 
    	        					 + "," +  Csv[40] 
    	        					 + "," +  Csv[41] 
    	        					 + "," +  Csv[42] 
    	        					 + "," +  Csv[43] 
    	        					 + "," +  Csv[44] 
    	        					 + "," +  Csv[45] 
    	        					 + "," +  Csv[46] 
    	        					 + "," +  Csv[47] 
    	        					 + "," +  Csv[48]
    	        					 + "," +  Csv[49]
    	        					 + "," +  Csv[50]
    	        					 + "," +  Csv[51]
    	        					 + "," +  Csv[52]
    	        					 + "," +  Csv[53]
    	        					 + "," +  Csv[54]
    	        					 + "," +  Csv[55]
    	        					 + "," +  Csv[56]
    	        					 + "," +  Csv[57]
    	        					 + "," +  Csv[58]
    	        					 + "," +  Csv[59]
    	        					 + "," +  Csv[60]
    	        					 + "," +  Csv[61] 
    	        					 + "," +  Csv[62]
    	        					 + "," +  Csv[63]
    	        					 + "," +  Csv[64]
    	        					 + "," +  Csv[65]
    	        					 + "," +  Csv[66]
    	        					 + "," +  Csv[67]);
     
    			}
     
    		} catch (FileNotFoundException e) {
    			e.printStackTrace();
    		} catch (IOException e) {
    			e.printStackTrace();
    		} finally {
    			if (br != null) {
    				try {
    					br.close();
    				} catch (IOException e) {
    					e.printStackTrace();
    				}
    			}
    		}
     
    		System.out.println("Done with reading CSV");
    	}
    }
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
    132
    133
    134
    135
    136
    137
    138
    139
    140
    141
    142
    143
    144
    145
    146
    147
    148
    149
    150
    151
    152
    153
    154
    155
    156
    157
    158
    159
    160
    161
    162
    163
    164
    165
    166
    167
    168
    169
    170
    171
    172
    173
    174
    175
    176
    177
    178
    179
    180
    181
    182
    183
    184
    185
    186
    187
    188
    189
    190
    191
    192
    193
    194
    195
    196
    197
    198
    199
    200
    201
    /*class */
    import java.io.BufferedReader;
    import java.io.FileNotFoundException;
    import java.io.FileReader;
    import java.io.IOException;
    import java.util.ArrayList;
    import java.util.List;
     
     
     
     
     
     
    public class CsvToJava {
     
     
    		public void convertCsvToJava() {
    			String csvFileToRead = "C:/Users/anaisf/Desktop/test.csv";
    			BufferedReader br = null;
    			String line = "";
    			String splitBy = ",";
    			List<Csv> csvList = new ArrayList<Csv>();
     
    			try {
     
    				br = new BufferedReader(new FileReader(csvFileToRead));
    				while ((line = br.readLine()) != null) {
     
    					// split on comma(',')
    					String[] Csv = line.split(splitBy);
     
    					// create car object to store values
    					Csv csvObject = new Csv();
     
    					// add values from csv to car object
     
    					csvObject.setGroup(Csv[0]);
    					csvObject.setYear(Csv[1]);
    					csvObject.setMonth(Csv[2]);
    					csvObject.setCustomers(Csv[3]);
    					csvObject.setAvgtxns(Csv[4]);
    					csvObject.setSdtxns(Csv[5]);
    					csvObject.setTxns(Csv[6]);
    					csvObject.setAvgamnt(Csv[7]);
    					csvObject.setAmnt(Csv[8]);
    					csvObject.setWithbranch(Csv[9]);
    					csvObject.setAvgbranchtxns(Csv[10]);
    					csvObject.setBranchtxns(Csv[11]);
    					csvObject.setAvgbranchamnt(Csv[12]);
    					csvObject.setBranchamnt(Csv[13]);
    					csvObject.setAvgADCtxns(Csv[14]);
    					csvObject.setADCtxns(Csv[15]);
    					csvObject.setAvgADCamnt(Csv[16]);
    					csvObject.setADCamnt(Csv[17]);
    					csvObject.setWithcashin(Csv[18]);
    					csvObject.setAvgcashin(Csv[19]);
    					csvObject.setCashin(Csv[20]);
    					csvObject.setAvgcashinamnt(Csv[21]);
    					csvObject.setCashinamnt(Csv[22]);
    					csvObject.setWithcashout(Csv[23]);
    					csvObject.setAvgcashout(Csv[24]);
    					csvObject.setCashout(Csv[25]);
    					csvObject.setAvgcashoutamnt(Csv[26]);
    					csvObject.setCashoutamnt(Csv[27]);
    					csvObject.setWithtransfer(Csv[28]);
    					csvObject.setAvgtransfer(Csv[29]);
    					csvObject.setTransfer(Csv[30]);
    					csvObject.setAvgtransferamnt(Csv[31]);
    					csvObject.setTransferamnt(Csv[32]);
    					csvObject.setWithbranchcashin(Csv[33]);
    					csvObject.setAvgbranchcashin(Csv[34]);
    					csvObject.setBranchcashin(Csv[35]);
    					csvObject.setAvgbranchcashinamnt(Csv[36]);
    					csvObject.setBranchcashinamnt(Csv[37]);
    					csvObject.setWithbranchcashout(Csv[38]);
    					csvObject.setAvgbranchcashout(Csv[39]);
    					csvObject.setBranchcashout(Csv[40]);
    					csvObject.setAvgbranchcashoutamnt(Csv[41]);
    					csvObject.setBranchcashoutamnt(Csv[42]);
    					csvObject.setWithADCcashin(Csv[43]);
    					csvObject.setAvgADCcashin(Csv[44]);
    					csvObject.setADCcashin(Csv[45]);
    					csvObject.setAvgADCcashinamnt(Csv[46]);
    					csvObject.setADCcashinamnt(Csv[47]);
    					csvObject.setWithADCcashout(Csv[48]);
    					csvObject.setAvgADCcashout(Csv[49]);
    					csvObject.setADCcashout(Csv[50]);
    					csvObject.setAvgADCcashoutamnt(Csv[51]);
    					csvObject.setADCcashoutamnt(Csv[52]);
    					csvObject.setWithloans(Csv[53]);
    					csvObject.setAvgloanoutst(Csv[54]);
    					csvObject.setLoanoutst(Csv[55]);
    					csvObject.setWithsavings(Csv[56]);
    					csvObject.setAversavingbal(Csv[57]);
    					csvObject.setSavingbal(Csv[58]);
    					csvObject.setWithcurrents(Csv[59]);
    					csvObject.setAvercurrentbal(Csv[60]);
    					csvObject.setCurrentbal(Csv[61]);
    					csvObject.setWithtds(Csv[62]);
    					csvObject.setAvertdbal(Csv[63]);
    					csvObject.setTdbal(Csv[64]);
    					csvObject.setWithttotalsavings(Csv[65]);
    					csvObject.setAvertotalbal(Csv[66]);
    					csvObject.setTotalbal(Csv[67]);
     
    					// adding csv objects to a list
    					csvList.add(csvObject);
     
    				}
    				// print values stored in csvList
    				printcsvList(csvList);
     
    			} catch (FileNotFoundException e) {
    				e.printStackTrace();
    			} catch (IOException e) {
    				e.printStackTrace();
    			} finally {
    				if (br != null) {
    					try {
    						br.close();
    					} catch (IOException e) {
    						e.printStackTrace();
    					}
    				}
    			}
    		}
     
     
    		public void printcsvList(List<Csv> csvListToPrint) {
    			for (int i = 0; i < csvListToPrint.size(); i++) {
    				System.out.println(csvListToPrint.get(i).getGroup()+ " , "+
    						+ csvListToPrint.get(i).getYear + " , "+
    						+ csvListToPrint.get(i).getMonth + " , "+
    						+ csvListToPrint.get(i).getCustomers + " , "+
    						+ csvListToPrint.get(i).getAvgtxns + " , "+
    						+ csvListToPrint.get(i).getSdtxns + " , "+
    						+ csvListToPrint.get(i).getTxns + " , "+
    						+ csvListToPrint.get(i).getAvgamnt + " , "+
    						+ csvListToPrint.get(i).getAmnt + " , "+
    						+ csvListToPrint.get(i).getWithbranch + " , "+
    						+ csvListToPrint.get(i).getAvgbranchtxns + " , "+
    						+ csvListToPrint.get(i).getBranchtxns + " , "+
    						+ csvListToPrint.get(i).getAvgbranchamnt + " , "+
    						+ csvListToPrint.get(i).getBranchamnt + " , "+
    						+ csvListToPrint.get(i).getAvgADCtxns + " , "+
    						+ csvListToPrint.get(i).getADCtxns + " , "+
    						+ csvListToPrint.get(i).getAvgADCamnt + " , "+
    						+ csvListToPrint.get(i).getADCamnt + " , "+
    						+ csvListToPrint.get(i).getWithcashin + " , "+
    						+ csvListToPrint.get(i).getAvgcashin + " , "+
    						+ csvListToPrint.get(i).getCashin + " , "+
    						+ csvListToPrint.get(i).getAvgcashinamnt + " , "+
    						+ csvListToPrint.get(i).getCashinamnt + " , "+
    						+ csvListToPrint.get(i).getWithcashout + " , "+
    						+ csvListToPrint.get(i).getAvgcashout + " , "+
    						+ csvListToPrint.get(i).getCashout + " , "+
    						+ csvListToPrint.get(i).getAvgcashoutamnt + " , "+
    						+ csvListToPrint.get(i).getCashoutamnt + " , "+
    						+ csvListToPrint.get(i).getWithtransfer + " , "+
    						+ csvListToPrint.get(i).getAvgtransfer + " , "+
    						+ csvListToPrint.get(i).getTransfer + " , "+
    						+ csvListToPrint.get(i).getAvgtransferamnt + " , "+
    						+ csvListToPrint.get(i).getTransferamnt + " , "+
    						+ csvListToPrint.get(i).getWithbranchcashin + " , "+
    						+ csvListToPrint.get(i).getAvgbranchcashin + " , "+
    						+ csvListToPrint.get(i).getBranchcashin + " , "+
    						+ csvListToPrint.get(i).getAvgbranchcashinamnt + " , "+
    						+ csvListToPrint.get(i).getBranchcashinamnt + " , "+
    						+ csvListToPrint.get(i).getWithbranchcashout + " , "+
    						+ csvListToPrint.get(i).getAvgbranchcashout + " , "+
    						+ csvListToPrint.get(i).getBranchcashout + " , "+
    						+ csvListToPrint.get(i).getAvgbranchcashoutamnt + " , "+
    						+ csvListToPrint.get(i).getBranchcashoutamnt + " , "+
    						+ csvListToPrint.get(i).getWithADCcashin + " , "+
    						+ csvListToPrint.get(i).getAvgADCcashin + " , "+
    						+ csvListToPrint.get(i).getADCcashin + " , "+
    						+ csvListToPrint.get(i).getAvgADCcashinamnt + " , "+
    						+ csvListToPrint.get(i).getADCcashinamnt + " , "+
    						+ csvListToPrint.get(i).getWithADCcashout + " , "+
    						+ csvListToPrint.get(i).getAvgADCcashout + " , "+
    						+ csvListToPrint.get(i).getADCcashout + " , "+
    						+ csvListToPrint.get(i).getAvgADCcashoutamnt + " , "+
    						+ csvListToPrint.get(i).getADCcashoutamnt + " , "+
    						+ csvListToPrint.get(i).getWithloans + " , "+
    						+ csvListToPrint.get(i).getAvgloanoutst + " , "+
    						+ csvListToPrint.get(i).getLoanoutst + " , "+
    						+ csvListToPrint.get(i).getWithsavings + " , "+
    						+ csvListToPrint.get(i).getAversavingbal + " , "+
    						+ csvListToPrint.get(i).getSavingbal + " , "+
    						+ csvListToPrint.get(i).getWithcurrents + " , "+
    						+ csvListToPrint.get(i).getAvercurrentbal + " , "+
    						+ csvListToPrint.get(i).getCurrentbal + " , "+
    						+ csvListToPrint.get(i).getWithtds + " , "+
    						+ csvListToPrint.get(i).getAvertdbal + " , "+
    						+ csvListToPrint.get(i).getTdbal + " , "+
    						+ csvListToPrint.get(i).getWithttotalsavings + " , "+
    						+ csvListToPrint.get(i).getAvertotalbal + " , "+
    						+ csvListToPrint.get(i).getTotalbal);
    			}
    		}
    }
    et la class main:

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    /**
     * @author 
     * 
     */
    public class Main {
    	public static void main(String[] args) {
     
    		// reading data from a csv file
    		System.out.println("Reading data from csv :");
    		ReadCsv readCsv = new ReadCsv();
    		readCsv.readCsv();
     
    		// reading data from a csv file and convert to java object
    		System.out.println("Reading data from csv and convert to java object:");
    		CsvToJava csvToJavaObject = new CsvToJava();
    		csvToJavaObject.convertCsvToJava();
    	}
    }
    je veux mettre mes objets (qui sortent en malheureusement en 0,0,0,0,0,0,0,0) dans une feuille de google spreadsheet. Je pense que j'ai un problème de raisonnement au niveau de mes classes Java (comme je suis débutante) en plus d'avoir un problème de connection OAuth2 et de manipulation de la documentation.

    Merci pour votre aide.

Discussions similaires

  1. Comment mettre à jour un formulaire A avec les infos du formulaire B ?
    Par Alexandrebox dans le forum Balisage (X)HTML et validation W3C
    Réponses: 2
    Dernier message: 02/04/2010, 14h06
  2. [MySQL] Mettre à jour une table mysql avec un fichier xml ou csv
    Par pasbonte dans le forum PHP & Base de données
    Réponses: 2
    Dernier message: 16/02/2009, 08h56
  3. Comment mettre à jour un champ BLOB avec une TIBQUERY ?
    Par colorid dans le forum Bases de données
    Réponses: 4
    Dernier message: 26/02/2008, 19h00
  4. Mettre à jour un champ Boolean avec une clause "WHERE"
    Par niano dans le forum Requêtes et SQL.
    Réponses: 3
    Dernier message: 02/10/2007, 11h29
  5. Mise à jour d'une table avec un fichier csv
    Par blackangel dans le forum PostgreSQL
    Réponses: 4
    Dernier message: 26/05/2005, 14h46

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo