[Date Prev][Date Next][Subject Prev][Subject Next][ Date Index][ Subject Index]

Reverse lines in a file?



Norman, you SHOULD be able to do this in one of two ways, employing
XyWrite's data capabilities.
1. Make sure there's a tab between each separate item ("field" in
database lingo) in each record, each record ends with a CR/LF, and that
there are the same number of items in each record. (That was so in your
sample). Then open settings.dfl, search for the SO (sort Order) setting
and change it to f3, since it's the 3d field, which begins with the date,
that you want to sort on. Command SORTD datafile,output.txt (or whatever
names you're using).
2. Bring the index fields to the front by running the data through a
mail-merge routine. Create a form file, consisting of the following:
XPLeNCODE v2.0
b-gin [UNTITLED]
{<}RR{<}NB{>}{<}PF3{>}{tab}{<}PF1{>}{tab}{<}PF2{>}[cr|lf]{<}B
B{>}{>}
-nd
XPLeNCODE
Store it, then command prints data+form (using the appropriate
filenames). Store the resulting screen, and then you'll have to clean out
a lot of empty lines and spaces. Now edit settings.dfl to change SO to f1
(because the field we want to sort on is now the first field), and do
SORTD again.

If the records weren't so long, you could use Column Define and sort that
way, but unless you have a printer driver that can print landscape on
tabloid (and I doubt any XyWrite one could), you're going to have runover
lines that will be left orphaned.

Personally, I would have kept all that in a database or even (heaven help
us!) a spreadsheet. If only Ibid for Xywrite had worked!

Patricia