Sponsored Content
Full Discussion: Find and Append
Top Forums Shell Programming and Scripting Find and Append Post 302859269 by fred3 on Wednesday 2nd of October 2013 04:38:33 PM
Old 10-02-2013
Hammer & Screwdriver Find and Append

I'm not sure this is the *best* idea but it's what occurs to me:
I have a long bibliographical list where the entries are in a variety of forms. So, there's no consistent format.
I can pretty much find the year of publication buried in each line. Everything else is a bit of a mess. So, human intervention is going to be necessary but I'd like to help that as much as possible.
So my thought is to find things and add them to the end of the line in each case. The year for example.
Then, I figure one could add other strings to the end that look "likely" for the title, author(s), etc.

I'd be happy right now simply knowing how to append what's found to the end of the line - so it will stand out to a reader/editor. Surely some amount of debugging will be needed and this seems like it would help the most.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

find, if exists then append for file with same name

I will have to process multiple files with same name everyday. My requirement is: If on a certain day I see that filename.txt exists then the contents of the filename.txt would be added/append to the former file contents.Each time it sees the file the content would be added.But the header ... (8 Replies)
Discussion started by: RubinPat
8 Replies

2. UNIX for Dummies Questions & Answers

Find, copy, and append into one file

Hi, I am trying to do something relatively easy, but am having some trouble getting it to work. I have multiple files called "distances.log" in numerous subdirectories and sub-subdirectories within a directory. I would like the contents of each of these "distances.log" files to be appended to a... (2 Replies)
Discussion started by: euspilapteryx
2 Replies

3. Shell Programming and Scripting

sed to find first appearance and append string

I have a file like below #GROUP A belongs to Asia GROUP A jojh hans local admin GROUP A gege fans michel jing jong #GROUP U belongs to USA GROUP U jeff goal hello world My requirement is to grep for first apperence of GROUP A which is not commented and append my name to end of file.... (12 Replies)
Discussion started by: vkk
12 Replies

4. Shell Programming and Scripting

[Solved] Find and append line to output

Hi All, I am trying to write a shell script but not getting desired output. What i am trying to do. 1.I want to use find command command and then use it xargs/exec to append the find output.But i am not getting desired output here is what i am trying to do #find init*.ora -exec `echo... (4 Replies)
Discussion started by: sahil_shine
4 Replies

5. Shell Programming and Scripting

Find string in a file and append character

Hi Experts, Is there a way to find a string in a file then append a character to that string then save the file or save to another file. Here is an example. >cat test.txt NULL NULL NULL 9,800.00 NULL 1,234,567.01 I want to find all NON NULL String and add a dollar sign to those... (9 Replies)
Discussion started by: brichigo
9 Replies

6. UNIX for Dummies Questions & Answers

Find diff between two patterns in two files and append

Hi, I'm a newbie at programming in Unix, and I seem to have a task that is greater than I can handle. Trying to learn awk by the way (but in the end, i just need something that works). My goal is to compare two files and output the difference between the two. I've been reading, and I think I... (5 Replies)
Discussion started by: legato22
5 Replies

7. Shell Programming and Scripting

How to append timestamp in the filenames using find?

Hi, How to change the filenames with timestamp in sub folders I have the following code to select the records. find . -type f -name '*pqr*' -ctime 1 -print The following is the example app_root_dir="/`echo $ScriptDir | cut -d'/' -f2`" $app_root_dir/../BadFiles directory uvw.bad... (3 Replies)
Discussion started by: bobbygsk
3 Replies

8. Shell Programming and Scripting

Stuck on a text find and append task

Hi, Bit of a tricky one for first post and hoping someone can help me out here. I've got some code that I'm trying to consolidate by taking the first line where it says "OUTPUT", remove the : and append it after a space where the are occurences of ".csv", and then take the next occurence of... (3 Replies)
Discussion started by: owl4528
3 Replies

9. Shell Programming and Scripting

Find keywords, and append at the end of line

Task: Find keywords in each line, and append at the end of line; if not found in the line, do nothing. the code is wrong. how to make it work. thanks a lot. cat keywords.txt | while read line; do awk -F"|" '{if (/$line/) {print $0"$line , ";} else print;}' outfile.txt > tmp ... (9 Replies)
Discussion started by: dtdt
9 Replies

10. Shell Programming and Scripting

Using sed to find and append or insert on SAME line

Hi, $ cat f1 My name is Bruce and my surname is I want to use SED to find “Bruce” and then append “ Lee” to the end of the line in which “Bruce” is found Then a more tricky one…. I want to INSERT ….a string… in to a line in which I find sometihng. So example $ cat f2 My name is... (9 Replies)
Discussion started by: Imre
9 Replies
REFER(1)						      General Commands Manual							  REFER(1)

NAME
refer, lookbib - find and insert literature references in documents SYNOPSIS
refer [ option ] ... lookbib [ file ] ... DESCRIPTION
Lookbib accepts keywords from the standard input and searches a bibliographic data base for references that contain those keywords anywhere in title, author, journal name, etc. Matching references are printed on the standard output. Blank lines are taken as delimiters between queries. Refer is a preprocessor for nroff or troff(1) that finds and formats references. The input files (standard input default) are copied to the standard output, except for lines between .[ and .] command lines, which are assumed to contain keywords as for lookbib, and are replaced by information from the bibliographic data base. The user may avoid the search, override fields from it, or add new fields. The reference data, from whatever source, are assigned to a set of troff strings. Macro packages such as ms(7) print the finished reference text from these strings. A flag is placed in the text at the point of reference; by default the references are indicated by numbers. The following options are available: -ar Reverse the first r author names (Jones, J. A. instead of J. A. Jones). If r is omitted all author names are reversed. -b Bare mode: do not put any flags in text (neither numbers nor labels). -cstring Capitalize (with CAPS SMALL CAPS) the fields whose key-letters are in string. -e Instead of leaving the references where encountered, accumulate them until a sequence of the form .[ $LIST$ .] is encountered, and then write out all references collected so far. Collapse references to the same source. -kx Instead of numbering references, use labels as specified in a reference data line beginning %x; by default x is L. -lm,n Instead of numbering references, use labels made from the senior author's last name and the year of publication. Only the first m letters of the last name and the last n digits of the date are used. If either m or ,n is omitted the entire name or date respec- tively is used. -p Take the next argument as a file of references to be searched. The default file is searched last. -n Do not search the default file. -skeys Sort references by fields whose key-letters are in the keys string; permute reference numbers in text accordingly. Implies -e. The key-letters in keys may be followed by a number to indicate how many such fields are used, with + taken as a very large number. The default is AD which sorts on the senior author and then date; to sort, for example, on all authors and then title use -sA+T. To use your own references, put them in the format described in pubindex(1) They can be searched more rapidly by running pubindex(1) on them before using refer; failure to index results in a linear search. When refer is used with eqn, neqn or tbl, refer should be first, to minimize the volume of data passed through pipes. FILES
/usr/dict/papers directory of default publication lists and indexes /usr/lib/refer directory of programs SEE ALSO
REFER(1)
All times are GMT -4. The time now is 05:34 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy