Współpracuję z AutoIT, aby dodać nowy wpis do pliku tekstowego. Jednak muszę go dodać między ostatnią linią a drugą ostatnią linią.
var informationtechnologydivisionmanager = [
{
"name": "Vacant",
"date": "02/6/2017",
"title": "Division Manager",
"mondayAM": "Main Campus AM",
"mondayPM": "Main Campus PM",
"tuesdayAM": "Main Campus AM",
"tuesdayPM": "Main Campus PM",
"wednesdayAM": "Main Campus AM",
"wednesdayPM": "Main Campus PM",
"thursdayAM": "Main Campus AM",
"thursdayPM": "Main Campus PM",
"fridayAM": "Main Campus AM",
"fridayPM": "Main Campus PM",
"saturdayAM": "Main Campus AM",
"saturdayPM": "Main Campus PM"
},
{
"name": "Vacant",
"date": "02/13/2017",
"title": "Division Manager",
"mondayAM": "Main Campus AM",
"mondayPM": "Main Campus PM",
"tuesdayAM": "Main Campus AM",
"tuesdayPM": "Main Campus PM",
"wednesdayAM": "Main Campus AM",
"wednesdayPM": "Main Campus PM",
"thursdayAM": "Main Campus AM",
"thursdayPM": "Main Campus PM",
"fridayAM": "Main Campus AM",
"fridayPM": "Main Campus PM",
"saturdayAM": "Main Campus AM",
"saturdayPM": "Main Campus PM"
},
{
"name": "Vacant",
"date": "02/20/2017",
"title": "Division Manager",
"mondayAM": "Main Campus AM",
"mondayPM": "Main Campus PM",
"tuesdayAM": "Main Campus AM",
"tuesdayPM": "Main Campus PM",
"wednesdayAM": "Main Campus AM",
"wednesdayPM": "Main Campus PM",
"thursdayAM": "Main Campus AM",
"thursdayPM": "Main Campus PM",
"fridayAM": "Main Campus AM",
"fridayPM": "Main Campus PM",
"saturdayAM": "Main Campus AM",
"saturdayPM": "Main Campus PM"
}
];
Kiedy zapisują nowe dane, chcę móc wstawić je po } i przed ];
Jestem bardzo nowy w AutoIT i staram się tego wszystkiego nauczyć.
When they save new data, I want to be able to insert it after the } and before the ];
?Odpowiedzi:
Jeśli potrzebujesz dokładnie dodać nowe dane między ostatnią linią a drugą ostatnią linią , możesz użyć tego kodu:
źródło
To powinno zacząć cię we właściwym kierunku:
źródło