FileContent.AppendText
Method | |
|---|---|
Module | FileContent |
Library | FileContent |
Action | Append text to a file. |
Parameters |
If the file already exists and has content then an encoding should not be specified. |
Return values | |
Example | Given an existing file @lines =
SELECT " { \"ac\": \"62781973\", \"sc\": \"05-21-07\", \"dob\": \"17-10-1993\" }" AS line
UNION SELECT ",{ \"ac\": \"01113201\", \"sc\": \"28-33-31\", \"dob\": \"12-01-1947\" }" AS line
UNION SELECT ",{ \"ac\": \"87290123\", \"sc\": \"20-35-27\", \"dob\": \"09-12-1996\" }" AS line
UNION SELECT ",{ \"ac\": \"72098345\", \"sc\": \"21-09-37\", \"dob\": \"07-03-1993\" }" AS line;
FileContent.WriteText(FilePath : "C:\\TIMS\\Data\\accounts.txt", Text : "{ \"closed\" : [", NewLine : true, Backup: true);
FOREACH @line IN @lines DO
FileContent.AppendText(FilePath : "C:\\TIMS\\Data\\accounts.txt", Text : @line, NewLine : true);
DONE;
FileContent.AppendText(FilePath : "C:\\TIMS\\Data\\accounts.txt", Text : "]}", NewLine : true); A backup { "closed" : [
{ "ac": "62781973", "sc": "05-21-07", "dob": "17-10-1993" }
,{ "ac": "01113201", "sc": "28-33-31", "dob": "12-01-1947" }
,{ "ac": "72098345", "sc": "21-09-37", "dob": "07-03-1993" }
,{ "ac": "87290123", "sc": "20-35-27", "dob": "09-12-1996" }
]} |
Platforms |
|
Notes |