Sponsored Content
Top Forums Shell Programming and Scripting Greping summaries of academic citations Post 302729051 by danbroz on Friday 9th of November 2012 02:18:11 AM
Old 11-09-2012
Greping summaries of academic citations

Hello friends,
I'm trying to grep out sentences. The sentences are previous to an academic citations in a pdf. The goal is to get summaries of citable work.

Her is what I tried reading the MAN page.

Code:
pdftotext foo.pdf | grep -A 5 ***chose reg expression below*** 


pdftotext BioPsych10.pdf | grep -A 5 \([A-Z]*[a-z]\,[1-2][0-9][0-9][0-9]\)

It pauses, but doesn't produce anything. Also it would be nice if I could stop printing at the start of the desired sentence, instead of 5 lines.


These are the regular expressions I will use.
(Daviis, 2004)
Code:
\([A-Z]*[a-z]\,[1-2][0-9][0-9][0-9]\)

(Schultz, 2000) and (White, 1989)
Code:
\([A-Z]*[a-z]\,[1-2][0-9][0-9][0-9]\) and \(, [A-Z]*[a-z]\,[1-2][0-9][0-9][0-9]\)

(Sutter, 1987; Reid and Shapley, 1992)
Code:
\([A-Z]*[a-z]\, [1-2][0-9][0-9][0-9]\; [A-Z]*[a-z] and [A-Z]*[a-z]\, [1-2][0-9][0-9][0-9]\)

(Enroth-Cugell and Robson, 1966)
Code:
\([A-Z]*[a-z]\-[A-Z]*[a-z] and [A-Z]*[a-z]\, [1-2][0-9][0-9][0-9]\

(Barlow, 1961, 1989; Atick and Redlich, 1990; Atick, 1992)
PHP Code:
\([A-Z]*[a-z]\, [1-2][0-9][0-9][0-9]\, [1-2][0-9][0-9][0-9]\; [A-Z]*[a-z] and [A-Z]*[a-z]\, [1-2][0-9][0-9][0-9]\; [A-Z]*[a-z]\, [1-2][0-9][0-9][0-9]\) 
(Dong and Atick, 1995a)
Code:
\([A-Z]*[a-z] and [A-Z]*[a-z]\, [1-2][0-9][0-9][0-9][a-z)\)

Thank you for taking the time to read this. Please let me know if you have any ideas.
 

8 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Help with greping a field

Hi, Suppose I have a file as below and I just want the field Invoice Number from this file , How can I do it. /home/arbor>cat PH0034090202314800030IM-001 0Yp825XMilperra NSW 1891 189110H14V1Sp2871Yp300X Customer Service : 0000-368-81118H6.5V0Sp3130Yp50X ... (7 Replies)
Discussion started by: rooh
7 Replies

2. Shell Programming and Scripting

need help in greping

i have a ksh script : #!/bin/ksh TZ=`date +%Z`+24 ;a=`date +%Y-%m-%d` b=`date +"%H:%M:%S"` cd /ednadtu3/u01/pipe/logs for i in Archiver1.log do cat $i | grep $a | grep $b >> /ednadtu3/u01/pipe/naveed/Insert_Date.txt done... (4 Replies)
Discussion started by: ali560045
4 Replies

3. Red Hat

Rebuilding C++ Libraries to save Linux install (purely academic question)

The crisis is over. I am just doing postmortem on how we handled it. So this is just an exercise in academics. We have a mission critical system running on RED Hat Linux. It is a turnkey system "managed 100% by the vendor". I put this is quotes because we had an event last night that... (0 Replies)
Discussion started by: Skyybugg
0 Replies

4. Shell Programming and Scripting

greping ip address

I have this line BTSRTRGRP-448-1-1 10.162.141.118/255.255.255.254 - I need to print only the IPADDRESS and not the subnet mask. If i use cut -c30-43 I get the ipaddress, where as in some cases if the last octet is of single digit (10.162.141.8/255.255.255.254) it... (2 Replies)
Discussion started by: miltonrods
2 Replies

5. Shell Programming and Scripting

Greping in between two different lines.

I know you could use the grep "something" -A200 flag to get all the lines past your pattern. Is there a way to get all the lines in between two patterns? The -a flag will not work since all lines in between the two patterns don't have a constant number. (4 Replies)
Discussion started by: jwillis0720
4 Replies

6. Shell Programming and Scripting

need help in greping

Hi, i have to find a string in a file and positin of the string in the file would come in some particular interval. let's say file is 1-1000 lines and string is in from 200-300line. could any one suggest me how to get make the grep search for the string in that particular portion of the... (4 Replies)
Discussion started by: tarakant
4 Replies

7. Shell Programming and Scripting

greping $2 into a list

Hi When I run this command: lsuser -a auditclasses ALL I got: user1 auditclasses=general,objects,cron,files,rbac,audit,lvm,aixpert user2 auditclasses=general,objects,cron,files,rbac,audit,lvm,aixpert user3 auditclasses=general,objects,cron,files,rbac,audit,lvm,aixpert user4... (7 Replies)
Discussion started by: iga3725
7 Replies

8. Shell Programming and Scripting

Latex/Bibtex - Error of no match for citations?

I'm trying to add citations to this latex formatted paper. I know the bibtex file is causing the issue. I will try to use this document as a reference once I have a working version. If anyone has an idea what these errors could mean that would help immensely. Any ideas how to fix would also be... (0 Replies)
Discussion started by: D2K
0 Replies
All times are GMT -4. The time now is 04:10 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy