Sponsored Content
Top Forums UNIX for Advanced & Expert Users find and copy string in a file Post 48005 by vascobrito on Tuesday 24th of February 2004 05:19:23 PM
Old 02-24-2004
I don't mean to get abusive, but how can i print those 48 lines where we looked for the match, plus the next 96 lines?
I've tryed some things with the script, but i think i have to learn much more to understand all the script. I understand the sintaxe, but i don't know how to change this.
thanks , once again
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

need to help to find and copy to a file

I am trying to search for files and copy them into a text file. Can anybody help me how to do that. find /test/sds/data -name "*.*" -mtime -365 -exec ls -altr {} \ this is my find command and want to copy the result to a file. (2 Replies)
Discussion started by: pujars1
2 Replies

2. UNIX for Advanced & Expert Users

How to copy a string to a text file

I am using the following command to email a tex file as an attachment- cat mailtext.txt | elm -s "Subject" emailAddr where content of mailtext.txt is - "Body of email" This will attach foo.txt with the email. My problem is that the file foo.txt is ceated dynamically everytime with a... (5 Replies)
Discussion started by: hpuxlxboy
5 Replies

3. Shell Programming and Scripting

Copy string from files into new file

I'm trying to copy a string (myame@yahoo.com) from multiple files and save them to a new file. This is what's I've gathered so far: sed 's/string/g' file.txt > output.txt Not sure how to run this on multiple files and extract just the email address found in each file. Any help would be... (2 Replies)
Discussion started by: rdell
2 Replies

4. Shell Programming and Scripting

find a string and copy the string after that

Hi! just want to seek help on this: i have a file wherein i want to find a string and copy the string after that and paste that other string to a new file. ex: TOTAL 123456 find "TOTAL" and copy "123456" and paste "123456" to a new file NOTE: there are many "TOTAL" strings on that... (12 Replies)
Discussion started by: kingpeejay
12 Replies

5. Shell Programming and Scripting

input a string and copy lines from a file with that string on it

i have a file1 with many lines. i have a script that will let me input a string. for example, APPLE. what i need to do is to copy all lines from file1 where i can find APPLE or any string that i specify and paste in on file 2 thanks in advance! (4 Replies)
Discussion started by: engr.jay
4 Replies

6. Linux

Find String in FileName and move the String to new File if not found

Hi all, I have a question.. Here is my requirement..I have 500 files in a path say /a/b/c I have some numbers in a file which are comma seperated...and I wanted to check if the numbers are present in the FileName in the path /a/b/c..if the number is there in the file that is fine..but if... (1 Reply)
Discussion started by: us_pokiri
1 Replies

7. Shell Programming and Scripting

Find string in XML file, copy contents of section

I am new, really new to bash scripts. I want to search an XML file for a certain string, say "1234567890" Once found, I want to copy the entire contents from the previous instance of the string "Entity" to the next instance of "/Entity" to a txt file. And then continue searching for the... (4 Replies)
Discussion started by: jrfiol
4 Replies

8. Shell Programming and Scripting

Find and copy files based on todays date and search for a particular string

Hi All, I am new to shell srcipting. Problem : I need to write a script which copy the log files from /prod/logs directory based on todays date like (Jul 17) and place it to /home/hzjnr0 directory and then search the copied logfiles for the string "@ending successfully on Thu Jul 17". If... (2 Replies)
Discussion started by: mail.chiranjit
2 Replies

9. Shell Programming and Scripting

Find string in file and find the all records by string

Hello I would like to get know how to do this: I got a big file (about 1GB) and I need to find a string (for instance by grep ) and then find all records in this file based on a string. Thanks for advice. Martin (12 Replies)
Discussion started by: mape
12 Replies

10. 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
curs_addchstr(3X)														 curs_addchstr(3X)

NAME
addchstr, addchnstr, waddchstr, waddchnstr, mvaddchstr, mvaddchnstr, mvwaddchstr, mvwaddchnstr - add a string of characters (and attributes) to a curses window SYNOPSIS
#include <curses.h> int addchstr(const chtype *chstr); int addchnstr(const chtype *chstr, int n); int waddchstr(WINDOW *win, const chtype *chstr); int waddchnstr(WINDOW *win, const chtype *chstr, int n); int mvaddchstr(int y, int x, const chtype *chstr); int mvaddchnstr(int y, int x, const chtype *chstr, int n); int mvwaddchstr(WINDOW *win, int y, int x, const chtype *chstr); int mvwaddchnstr(WINDOW *win, int y, int x, const chtype *chstr, int n); DESCRIPTION
These routines copy chstr into the window image structure at and after the current cursor position. The four routines with n as the last argument copy at most n elements, but no more than will fit on the line. If n=-1 then the whole string is copied, to the maximum number of characters that will fit on the line. The window cursor is not advanced, and these routines work faster than waddnstr. On the other hand, they don't perform any kind of check- ing (such as for the newline, backspace, or carriage return characters), they don't advance the current cursor position, they don't expand other control characters to ^-escapes, and they truncate the string if it crosses the right margin, rather then wrapping it around to the new line. RETURN VALUES
All routines return the integer ERR upon failure and OK on success (the SVr4 manuals specify only "an integer value other than ERR") upon successful completion, unless otherwise noted in the preceding routine descriptions. NOTES
Note that all routines except waddchnstr may be macros. PORTABILITY
All these entry points are described in the XSI Curses standard, Issue 4. SEE ALSO
curses(3X). curs_addchstr(3X)
All times are GMT -4. The time now is 02:36 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy