jpeck

jpeck / FileReverse / 0.1.0

README.md

Overview

Reverses the content of a text file and writes to a new file, demonstrating options for specifying or autogenerating output file location/name

Parameters

"infile": web URL or data URI of input text file

"outfile": (optional) data URI of full directory/filename for output

"outdir": (optional) data URI of full directory for output (filename will be an GUID followed by ".txt")

If both "outfile" and "outdir" are specified, "outdir" is ignored.

If both "outfile" and "outdir" are omitted, the file will named [GUID].txt and placed in .algo/temp/(aka data://.algo/jpeck/FileReverse/temp/[GUID].txt)

If the input is a bare string instead of an Object (dict/map), the value will be used as if it were "infile"

Usage #1: bare URL

Input

"https://www.w3.org/TR/PNG/iso_8859-1.txt" or "data://jpeck/demopublic/burning_daylight.txt" or {"infile":"https://www.w3.org/TR/PNG/iso_8859-1.txt"}

Output

"data://.algo/temp/6ddc2ef7-0804-4f27-8d7e-d9cb9f70e7aa.txt"

Usage #2: specify output file

Input

{"infile":"https://www.w3.org/TR/PNG/iso_8859-1.txt","outdir":"data://auser/acollection/afile.txt"}

Output

"data://auser/acollection/afile.txt"

Usage #3: specify output directory

Input

{"infile":"https://www.w3.org/TR/PNG/iso_8859-1.txt","outdir":"data://auser/acollection/"}

Output

"data://auser/acollection/6ddc2ef7-0804-4f27-8d7e-d9cb9f70e7aa.txt"