LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 12-22-2014, 08:06 AM   #1
son.lun
LQ Newbie
 
Registered: Dec 2014
Posts: 7

Rep: Reputation: Disabled
...


...

Last edited by son.lun; 12-22-2014 at 04:56 PM.
 
Old 12-22-2014, 09:30 AM   #2
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,792

Rep: Reputation: 7306Reputation: 7306Reputation: 7306Reputation: 7306Reputation: 7306Reputation: 7306Reputation: 7306Reputation: 7306Reputation: 7306Reputation: 7306Reputation: 7306
please open a new thread, do not continue posting into old threads....
 
Old 12-22-2014, 09:36 AM   #3
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,792

Rep: Reputation: 7306Reputation: 7306Reputation: 7306Reputation: 7306Reputation: 7306Reputation: 7306Reputation: 7306Reputation: 7306Reputation: 7306Reputation: 7306Reputation: 7306
the perl script you posted does something else, it does not work on paragraphs but count words.
How do you want to identify paragraphs?
 
Old 12-22-2014, 10:56 AM   #4
son.lun
LQ Newbie
 
Registered: Dec 2014
Posts: 7

Original Poster
Rep: Reputation: Disabled
...

Last edited by son.lun; 12-22-2014 at 04:53 PM.
 
Old 12-22-2014, 12:12 PM   #5
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,792

Rep: Reputation: 7306Reputation: 7306Reputation: 7306Reputation: 7306Reputation: 7306Reputation: 7306Reputation: 7306Reputation: 7306Reputation: 7306Reputation: 7306Reputation: 7306
do you think something like this:
Code:
#!/usr/bin/perl -w
use strict;

open F, "/tmp/pubmedresults.txt" or die $!;

my $l;
while (defined ($l = <F>)) {
    my ($a, $b) = ($l =~ /^([^- ]+)\s*-\s*(.*)/);
    next if ! defined $a;
    if ( $a eq "PMID" ) {
         print "$b\n";
         open O, ">$b";
    }
    if ( $a eq "AB" ) {
        print O "$b\n";
        while (<F>) {
           last if ( /^\w/ );
           print O;
       }
       printf O "\n";
       close O;
    }
}
 
Old 12-22-2014, 04:10 PM   #6
son.lun
LQ Newbie
 
Registered: Dec 2014
Posts: 7

Original Poster
Rep: Reputation: Disabled
...

Last edited by son.lun; 12-22-2014 at 05:45 PM.
 
Old 12-22-2014, 04:20 PM   #7
son.lun
LQ Newbie
 
Registered: Dec 2014
Posts: 7

Original Poster
Rep: Reputation: Disabled
...

Last edited by son.lun; 12-22-2014 at 05:44 PM.
 
Old 12-22-2014, 05:47 PM   #8
son.lun
LQ Newbie
 
Registered: Dec 2014
Posts: 7

Original Poster
Rep: Reputation: Disabled
....
 
Old 12-22-2014, 11:35 PM   #9
NevemTeve
Senior Member
 
Registered: Oct 2011
Location: Budapest
Distribution: Debian/GNU/Linux, AIX
Posts: 4,856
Blog Entries: 1

Rep: Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869
(I suggest you ask your next question with a different nickname.)
 
Old 12-23-2014, 03:42 AM   #10
dugan
LQ Guru
 
Registered: Nov 2003
Location: Canada
Distribution: distro hopper
Posts: 11,219

Rep: Reputation: 5309Reputation: 5309Reputation: 5309Reputation: 5309Reputation: 5309Reputation: 5309Reputation: 5309Reputation: 5309Reputation: 5309Reputation: 5309Reputation: 5309
Just so you know, son.lun. "Do not destroy content" (including your own) is one of the unwritten rules here. I have seen people banned for it, and I recommend that you restore your posts.

Last edited by dugan; 12-23-2014 at 05:03 AM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to do search & replace on a text file--need to extract URLs from a sitemap file Mountain Linux - General 4 08-07-2015 10:52 AM
[SOLVED] Extract multiple lines of data from a text file. shawnamiller Programming 8 04-30-2010 11:46 AM
Batch Text Extract Multiple Files lixbie Programming 10 07-02-2008 09:56 AM
Extract certain text info from text file xmrkite Linux - Software 30 02-26-2008 11:06 AM
Combine multiple one column text file into one text file with multiple colum khairilthegreat Linux - Newbie 7 11-23-2007 01:31 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 11:07 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration