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

RE: How to truncat



A simple program can do the job within XyWrite as follows:

The examples you give seem to be of entries followed by two carrier returns.
If this is the case then you need to reduce double-returns by
single-returns. Prepare a copy of the original file by going to the command
line and change-invisible two carriage-returns (ctrl-enter) to one.

Make a new program file. In record mode (manual page 5-92) clear the command
line, search for a carriage return (this puts your cursor on the beginning
of the line following the carriage return) then right-cursor as many times
as you want to keep, then begin-define, search for the next carriage-return,
end-define, delete-defined-block, enter a new carriage-return (to replace
the one you just deleted), clear the command-line, type "run [programfile]"
(where [programfile] is the name of your program file) and end record. save
the program file, load it, and run it. You will have to hit F9 as many
times as you have entries (or you could add it before you end record mode,
but you will keep having memory problems). This should do the trick.

Regards,

Paul Ambos
pambos@xxxxxxxx



> -----Original Message-----
> From:	Norman Bauman [SMTP:nbauman@xxxxxxxx]
> Sent:	Sunday, January 26, 2003 10:10 PM
> To:	xywrite@xxxxxxxx
> Subject:	How to truncat
>
> I have a file in XyWrite (3.55) which contains entries like the following,
> each one a single line ended by a carrier return. I would like to get a
> file in which each of the lines is truncated, after about 12 or 16
> characters. (The reason is that I want to sort them and find the unique
> journal abbreviations.) I have about 500 lines so it would be tedious to
> do
> it by hand. Is there an easy way to truncate lines like this, using simple
> functions of XyWrite, DOS utilities, or the usual programs I'm likely to
> have around? I could write a XyWrite macro to define the first few words
> in
> the file, and copy it to a second file, since some of the publication
> names
> are 3 or 4 words. Or I could have a macro start define, cursor over N
> spaces, end define, and copy it to a second file. But that sounds clunky.
> There should be an easy way.
>
> SciAm, Feb 2002, Down with the bad, up with the good, Thomas Maeder.
> Vaccines to enzymes on the cholesterol cascade raise HDL and lower LDL in
> rabbits, and are now in phase II trials.
>
> NEJM, 24 Jan 2002, 346(4), CHOP chemotherapy plus rituximab in elderly
> patients with diffuse large B-cell lymphoma, B. Coiffier et al.
> Cyclophosphamide, doxorubicin, vincristine and prednisone (CHOP) were used
> with and without rituximab. The response with rituximab was significantly
> higher.
>
> JAMA, 23/30 Jan 2002, 287(4), Chelation therapy for ischemic heart
> disease:
> a randomized controlled trial, Merril L. Knudtson et al. "There is no
> evidence to support a beneficial effect of chelation therapy in patients
> with ischemic heart disease, stable angina, and a positive treadmill test
> for ischemia."
>
> -------------------------------------------------------
> Norman Bauman
> 411 W. 54 St. Apt. 2D
> New York, NY 10019
> (212) 977-3223
> http://www.nasw.org/users/nbauman
> Alternate address: nbauman@xxxxxxxx
> -------------------------------------------------------