How can I modify this list automatically?

Dimitri

Member
I'm in a big jam!

I have to get something done for school and if I go about it manually I won't be done till waaaay past my deadline.

I have a list of word entries in the .rtf format (this is the Microsoft Wordpad) in this form:

snowflake; snowflake baby; Snowflakes baby; snowflake child n Child resulting
from the in utero transplantation of a previously frozen embryo [2000 Mar
29 Twila Decker St Petersburg (Fla) Times 1D (LexisNexis) In California, a
Christian adoption agency has formed an organization called Snowflake to
facilitate adoptions of embryos and to spearhead new protocols and laws.
Snowflake also encourages clinics to create fewer embryos so there aren’t so
many leftovers.] 2001 Aug 8 Kathy Kiely & Mimi Hall USA Today 1A
(LexisNexis) “Nothing is more heart-wrenching than to see those little ‘snow-
flakes’ brought into a hearing room,” House Majority Whip Tom DeLay,
R-Texas, says. Abortion opponents use that term for the children born to cou-
ples who adopted leftover frozen embryos from in vitro fertilization clinics.
2003 Mar 24 Suzanne Smalley Newsweek 53 (http://www.doubletongued.org/
index.php/dictionary/snowflake_baby/) Snowflakes, the first embryo-adop-
tion program in the country, began matching donor embryos to infertile wom-
en in 1997 with the help of the conservative Christian group Focus on the
Family. . . . So far, 19 Snowflakes babies have been born and 15 more women in
the program are pregnant. 2004 June 13 James Dobson Face the Nation CBS-
TV (transcript; http://www.cbsnews.com/htdocs/pdf/face_61304.pdf) And
I—with regard to all those—all those cells—those embryos that are going to be
discarded, 97 percent of the parents of those embryos will not release them for
scientific research. That’s already been tried. And of the 3 percent, there are
babies being born every few days—they’re called snowflake babies—that come
from those frozen embryos. 2005 May 20 Jeff Nesmith Atlanta Journal-
Constitution 8A (LexisNexis) Rep. Phil Gingrey (R-Ga.), one of three other
House physicians who appeared with Weldon, said that because of these non-
embryonic stem cells, “we do not have to cross this divide and get into all these
ethical dilemmas” in order to pass a bill to remove the Bush administration’s
research funding limitations. [¶] “My feeling, very strongly, is that there are no
throwaway lives,” Gingrey said, adding that he thought “those who believe in
the sanctity of life” would agree with him. [¶] Gingrey said opponents will bring
“snowflake children”—born after unused embryos were “adopted” by infertile
couples—to Capitol Hill for the upcoming debate. May 25 Samantha Levine
& Julie Mason Houston Chronicle A1 (LexisNexis; head & text) ‘Snowflake’ ba-
bies bring the debate to life; Couples use frozen embryos to become parents
despite infertility / J.J. and Tracy Jones are the proud Houston-area parents of
a “snowflake.” [¶] That is, a 1-month-old boy who spent two years as another
family’s preserved embryo before he was adopted by the Cypress couple, car-
ried in Tracy’s womb and delivered in April. [¶] The ardent backers of the
largely unknown and unregulated process of embryo adoption call the chil-
dren snowflakes because, like all children and snowflakes, each is unique, but
unlike most children, they were once frozen. June 6 Top 10 Conservative
Idiots No. 200 http://www.democraticunderground.com/top10/05/200.html
There are currently about 400,000 frozen embryos in storage, and about 9,000
of the 400,000 frozen embryos are available for “adoption” by other people.
People who adopt these embryos can get them implanted and attempt to have
a so-called “snowflake” baby, which is somewhat Aryan-sounding but that’s an-
other story. But guess what? Typically clinics will transfer up to four embryos to
the uterus for possible implantation. And three out of four of those embryos
die without developing into a fetus. So every time people try to have a snow-
flake baby, they’re killing three other “babies.” 2006 July 22 Rupert Cornwell
Independent (London) 35 (LexisNexis) As was to be expected, Bush announced
his decision at one of those elaborately choreographed White House ceremo-
nies, surrounded by so-called “snowflake” children born from frozen embryos
at in vitro fertilisation clinics.

.... and I would need each such entry in the following form:

snowflake; snowflake baby; Snowflakes baby; snowflake child (n Child resulting from the in utero transplantation of a previously frozen embryo)

So typically, these entries will give a word (if multiple forms of the word, then separated by ;) and then "n," which means "noun," so it could be adj, adv, gerun etc., and then it gives a text that explains the meaning of the word, and after that it gives excerpts from texts which show the word used, these excerpts always start with a year.

So is there any program or something that I could use that would wipe off all the text after the year and format the preceding part as I formatted it in the second quote?
 
Approximately

arr = string.split("\[|\]");
for (x=0; x<length(arr)/2; x++){
print arr[x] + " [" + arr[x+1] + "]";
}

less any bugs because I didn't actually test this.
 
I'm in a big jam!

I have to get something done for school and if I go about it manually I won't be done till waaaay past my deadline.

I have a list of word entries in the .rtf format (this is the Microsoft Wordpad) in this form:



.... and I would need each such entry in the following form:



So typically, these entries will give a word (if multiple forms of the word, then separated by ;) and then "n," which means "noun," so it could be adj, adv, gerun etc., and then it gives a text that explains the meaning of the word, and after that it gives excerpts from texts which show the word used, these excerpts always start with a year.

So is there any program or something that I could use that would wipe off all the text after the year and format the preceding part as I formatted it in the second quote?

I don't think there is a program to do what you're asking. I mean are you wanting to categorize nouns, etc?

If you're looking to make it one big continuous line, then check out Notepad ++. Copy the text into it and select Edit/Blank Operations/ EOL To Space.
 
I don't think there is a program to do what you're asking. I mean are you wanting to categorize nouns, etc?

If you're looking to make it one big continuous line, then check out Notepad ++. Copy the text into it and select Edit/Blank Operations/ EOL To Space.

No, I'm looking to reshape the list. Right now the words are in the form as in the first quote, the big box of text, and I need to get rid of everything except the word itself and then in () the word type (n, adj, adv or whatever) and the text explaining what the word means, formatted in that way, for ex.:

leg (n part of body used for walking)
 
I would consider going to stack exchange with your text and see if someone can help you format this text like you want it using Notepad ++. I'm not sure if Notepad ++ can do it, but it's a damn versatile little notepad, that I can tell you. It has saved me a lot of time.
 
I would consider going to stack exchange with your text and see if someone can help you format this text like you want it using Notepad ++. I'm not sure if Notepad ++ can do it, but it's a damn versatile little notepad, that I can tell you. It has saved me a lot of time.
Stackover flow will give you an answer similar to mine.

Notepad++ can do it. It has a regex search/replace function. Not really different from what I have above.
What do I do with this :) I'm not programming savvy.
I did the hard part. Seems only fair to let you do the rest of your assignment ;)
 
Back
Top