in reply to Re^2: Use Perl's Sort to only sort certain lines in a file?
in thread Use Perl's Sort to only sort certain lines in a file?
Thanks for your interesting help. The more I look at things the more I seem to think that I would like the cleanliness of subroutines. Sad admission, I've been doing most things inside one large "while" loop.
When I used your code I added an open line called "Input" and exchanged my $line = <$fh> with my $line = <Input>. If I didn't do that I got an error:
Ought I have done that?Name "main::Data" used only once: possible typo at untitled text line +9. readline() on unopened filehandle Data at untitled text line 16.
The output, when I made that change, however looked exactly like the input file. If I gave a sample of the actual text would that help?
fi a bunch of text that isn't important :– dear (13) dear friends (22) love (10) dear friend (10) loved (3) dearly loved (1) friends (1) loved so much (1 [+(xi)1181(-i)]) fi more unimportant text :– competes in the games (1) contend (1) fight (2) fought (1) make every effort (1) strive (1) wrestling (1)
No matter what I tried to mess with I could not get the data to change like you showed in your example.
Thanks for all the help!
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Use Perl's Sort to only sort certain lines in a file?
by Anonymous Monk on Jan 02, 2015 at 02:02 UTC | |
by grahambuck (Acolyte) on Jan 02, 2015 at 03:10 UTC | |
by Anonymous Monk on Jan 02, 2015 at 03:40 UTC | |
by grahambuck (Acolyte) on Jan 02, 2015 at 06:03 UTC | |
by Anonymous Monk on Jan 02, 2015 at 07:36 UTC |