Sponsored Content
Top Forums Shell Programming and Scripting input a string and copy lines from a file with that string on it Post 302534498 by engr.jay on Tuesday 28th of June 2011 04:26:38 AM
Old 06-28-2011
no, it's not an assignment.

string=$word

i used awk '/$word/' input_file but it failed
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

search string in a file and retrieve 10 lines including string line

Hi Guys, I am trying to write a perl script to search a string "Name" in the file "FILE" and also want to create a new file and push the searched string Name line along with 10 lines following the same. can anyone of you please let me know how to go about it ? (8 Replies)
Discussion started by: sukrish
8 Replies

2. Shell Programming and Scripting

Find a string in textfile, erase $num lines after that string

I have a textfile containing text similar to the following pattern: STRING1 UNIQUE_STRING1 STRING2 STRING3 STRING4 STRING5 STRING1 UNIQUE_STRING2 STRING2 STRING3 STRING4 STRING5 STRING1 UNIQUE_STRING3 STRING2 STRING3 (6 Replies)
Discussion started by: ilcsfe
6 Replies

3. Shell Programming and Scripting

replace (sed?) a single line/string in file with multiple lines (string) from another file??

Can someone tell me how I can do this? e.g: Say file1.txt contains: today is monday the 22 of NOVEMBER 2010 and file2.txt contains: the 11th month of How do i replace the word NOVEMBER with (5 Replies)
Discussion started by: tuathan
5 Replies

4. Shell Programming and Scripting

replace (sed?) a string in file with multiple lines (string) from variable

Can someone tell me how I can do this? e.g: a=$(echo -e wert trewt ertert ertert ertert erttert erterte rterter tertertert ert) How do i replace the STRING with $a? I try this: sed -i 's/STRING/'"$a"'/g' filename.ext but this don' t work (2 Replies)
Discussion started by: jforce
2 Replies

5. Shell Programming and Scripting

Grep a string from input file and delete next three lines including the line contains string in xml

Hi, 1_strings file contains $ cat 1_strings /home/$USER/Src /home/Valid /home/Review$ cat myxml <projected value="some string" path="/home/$USER/Src"> <input 1/> <estimate value/> <somestring/> </projected> <few more lines > <projected value="some string" path="/home/$USER/check">... (4 Replies)
Discussion started by: greet_sed
4 Replies

6. Shell Programming and Scripting

Matching string from input to string of file

Hi, i want to know how to compare string of file with input string im trying following code: file_no=`paste -s -d "||||\n" a.txt | cut -c 1` #it will return collection number from file echo "enter number" read " curr_no" if ; then echo " current number already present" fi ... (4 Replies)
Discussion started by: a_smith
4 Replies

7. Shell Programming and Scripting

Insert String every n lines, resetting line counter at desired string

I need to read a text file and insert a string every n lines, but also have the line counter restart when I come across a header string. Line repeating working every 3 lines using code: sed '0~3 s/$/\nINSERT/g' < INPUT/PATH/FILE_NAME.txt > OUTPUT/PATH/FILE_NAME.txt I cannot seem to find... (1 Reply)
Discussion started by: Skonectthedots
1 Replies

8. Shell Programming and Scripting

How to find previous string based on an input string?

Hi, I did some research but cannot find the right solution so hopefully someone can help me here. I have a long string format like: VAR=111:aaaa,222:bbb,333:ccc it could be VAR=111:aaa,222:bbb,333:ccc,444:ddd, etc what I looking for is eg. if I give ccc, it will return me 333... (2 Replies)
Discussion started by: netbanker
2 Replies

9. Shell Programming and Scripting

Copy a string to another file

OS version: RHEL 6.7 Shell : Bash I have a file like below. It has 500K lines. I want to extract TAG_IDs shown in single quote at the end to copied to another file. As if I had copied the TAG_IDs using block select (Column Select) in modern text editor $ cat file.txt UPDATE TAGREF SET... (9 Replies)
Discussion started by: John K
9 Replies

10. Shell Programming and Scripting

Insert a user input string after matched string in file

i am having file like this #!/bin/bash read -p 'Username: ' uservar match='<color="red" />' text='this is only a test so please be patient <color="red" />' echo "$text" | sed "s/$match/&$uservar\g" so desireble output what i want is if user type MARIA this is only a test so please... (13 Replies)
Discussion started by: tomislav91
13 Replies
lt-proc(1)																lt-proc(1)

NAME
lt-proc - This application is part of the lexical processing modules and tools ( lttoolbox ) This tool is part of the apertium machine translation architecture: http://apertium.sf.net. SYNOPSIS
lt-proc [ -a | -g | -n | -p | -s | -v | -h ] fst_file [input_file [output_file]] lt-proc [ --analysis | --generation | --non-marked-gen | --post-generation | --sao | --version | --help ] fst_file [input_file [out- put_file]] DESCRIPTION
lt-proc is the application responsible of providing the four lexical processing functionalities o morphological analyser ( option -a ) o lexical transfer ( option -n ) o morphological generator ( option -g ) o post-generator ( option -p ) It accomplishes these tasks by reading binary files containing a compact and efficient representation of dictionaries (a class of finite- state transducers called augmented letter transducers). These files are generated by lt-comp(1). It is worth to mention that some characters (`[', `]', `$', `^', `/', `+') are special chars used for format and encapsulation. They should be escaped if they have to be used literally, for instance: `['...`]' are ignored and the format of a linefeed is `^...$'. OPTIONS
-a, --analysis Tokenizes the text in surface forms (lexical units as they appear in texts) and delivers, for each surface form, one or more lexical forms consisting of lemma, lexical category and morphological inflection information. Tokenization is not straightforward due to the existence, on the one hand, of contractions, and, on the other hand, of multi-word lexical units. For contractions, the system reads in a single surface form and delivers the corresponding sequence of lexical forms. Multi-word surface forms are analysed in a left- to-right, longest-match fashion. Multi-word surface forms may be invariable (such as a multi-word preposition or conjunction) or inflected (for example, in es, "echaban de menos", "they missed", is a form of the imperfect indicative tense of the verb "echar de menos", "to miss"). Limited support for some kinds of discontinuous multi-word units is also available. Single-word surface forms analysis produces output like the one in these examples: "cantar" -> `^cantar/cantar<vblex><inf>$' or "cantaba" -> `^cantaba/can- tar<vblex><pii><p1><sg>/cantar<vblex><pii><p3><sg>$'. -g, --generation Delivers a target-language surface form for each target-language lexical form, by suitably inflecting it. -n, --non-marked-gen Morphological generation (like -g) but without unknown word marks (asterisk `*'). -p, --post-generation Performs orthographical operations such as contractions and apostrophations. The post-generator is usually dormant (just copies the input to the output) until a special alarm symbol contained in some target-language surface forms wakes it up to perform a particu- lar string transformation if necessary; then it goes back to sleep. -s, --sao Input processing is in orthoepikon (previosuly `sao') annotation system format: http://orthoepikon.sf.net. -v, --version Display the version number. -h, --help Display this help. FILES
input_file The input compiled dictionary. SEE ALSO
lt-expand(1), lt-comp(1), apertium-tagger(1), apertium-translator(1). BUGS
Lots of...lurking in the dark and waiting for you! AUTHOR
(c) 2005,2006 Universitat d'Alacant / Universidad de Alicante. All rights reserved. 2006-03-23 lt-proc(1)
All times are GMT -4. The time now is 05:40 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy