Sponsored Content
Top Forums UNIX for Dummies Questions & Answers How to export some lines from a file to a new file? Post 302723373 by pamu on Tuesday 30th of October 2012 03:26:00 AM
Old 10-30-2012
Quote:
Originally Posted by phamnu
grep 'F(tot: 1' ft.09 F1.txt
I created the file F1.txt before the grep command.
Using Elixir's code you don't need to create file before grep.

Code:
grep 'F(tot:  1' ft.09 > F1.txt

If you want to append data into the file then just use >> instead of >.Smilie
This User Gave Thanks to pamu For This Post:
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

awk/sed Command : Parse parameter file / send the lines to the ksh export command

Sorry for the duplicate thread this one is similar to the one in https://www.unix.com/shell-programming-scripting/88132-awk-sed-script-read-values-parameter-files.html#post302255121 Since there were no responses on the parent thread since it got resolved partially i thought to open the new... (4 Replies)
Discussion started by: rajan_san
4 Replies

2. Shell Programming and Scripting

Extra/parse lines from a file between unque lines through the file

I need help to parse a file where there are many records, all of which are consistently separated by lines containing “^=============” and "^ End of Report". Example: ============= 1 2 3 4 End of record ============= 1 3 4 End of record Etc.... I only need specific lines... (5 Replies)
Discussion started by: jouuu
5 Replies

3. Shell Programming and Scripting

How to export a unix file to txt file?

Is there any way by which u can export a file in unix box to a notepad or txt file?:confused: (3 Replies)
Discussion started by: nohup
3 Replies

4. Shell Programming and Scripting

bash mysql export to file

I'm trying to export a mysql query to a .csv file, right now I'm running a successful query like: us_id=`mysql -u $USER_NAME --password=$PASSWORD -D "databasename" \ -e "SELECT * \ FROM databasename.table \ WHERE somefield >0 AND otherfield ='$ctry' \ ORDER BY... (1 Reply)
Discussion started by: unclecameron
1 Replies

5. Shell Programming and Scripting

help t export the variable from a particular file

Hello Guys, I need you help to do one task I have script which is actually doing to fetch the code of any repository in svn for e.g.:- I can use svn to checkout the repository but I want to checkout the repository for particular tag like svn co <url>/svn/repo/<tag-name> and this... (1 Reply)
Discussion started by: rohit22hamirpur
1 Replies

6. Shell Programming and Scripting

Extract some lines from one file and add those lines to current file

hi, i have two files. file1.sh echo "unix" echo "linux" file2.sh echo "unix linux forums" now the output i need is $./file2.sh unix linux forums (3 Replies)
Discussion started by: snreddy_gopu
3 Replies

7. AIX

wtmp file - is there a patch to export the data another file each day?

sorry for being a noob, i am trying to find which user accessed the server at what time and there ip address at first i used who command but the output didn't contain the ip address then i used the last command which provided me with the ip of the users but when i searched i searched and found that... (1 Reply)
Discussion started by: hercules_1010
1 Replies

8. Shell Programming and Scripting

How to export the string to a text file.

Hi, I have used this find . -type f -exec grep "491629461544" {} \; > test.txt to find the string and export it to file. The problem is, when i used the above command in Shell script, the file is created but the searched string is recursively written in that file and even the file... (10 Replies)
Discussion started by: nanthagopal
10 Replies

9. Shell Programming and Scripting

Find all lines in file such that each word on that line appears in at least n lines of the file

I have a file where every line includes four expressions with a caret in the middle (plus some other "words" or fields, always separated by spaces). I would like to extract from this file, all those lines such that each of the four expressions containing a caret appears in at least four different... (9 Replies)
Discussion started by: uncleMonty
9 Replies

10. Shell Programming and Scripting

If the 1th column of file f1 and file f2 is the same, then export those line with maximum string of

please help to write a awk command-line programs to achieve the following functions: Thank in advance. Requeset Description: compare two files f1 and f2, export to file f3: 1 Delete duplicate rows of in file f1 and file f2 2 If the 1th column of file f1 and file f2 is the same, then export... (1 Reply)
Discussion started by: weichanghe2000
1 Replies
CURSES_INSDEL(3)					   BSD Library Functions Manual 					  CURSES_INSDEL(3)

NAME
curses_insdelln, insdelln, winsdelln -- curses insert or delete lines routines LIBRARY
Curses Library (libcurses, -lcurses) SYNOPSIS
#include <curses.h> int insdelln(int n); int winsdelln(WINDOW *win, int n); DESCRIPTION
These functions insert or delete lines on stdscr or on the specified window. If insdelln() is called with a positive number in n, then the specified number of lines are inserted before the current line on stdscr. The last n lines of the screen are no longer displayed. If n is negative, then n lines are deleted from stdscr, starting at the current line. The last n lines of stdscr are cleared. The winsdelln() function is the same as the insdelln() function, excepting that lines are inserted or deleted from the window specified by win. If a scrolling region has been set with the setscrreg() or wsetscrreg() functions and the current cursor position is inside the scrolling region, then only the lines from the current line to the bottom of the scrolling region are affected. RETURN VALUES
Functions returning pointers will return NULL if an error is detected. The functions that return an int will return one of the following values: OK The function completed successfully. ERR An error occurred in the function. SEE ALSO
curses_deleteln(3), curses_insertln(3), curses_scroll(3) STANDARDS
The NetBSD Curses library complies with the X/Open Curses specification, part of the Single Unix Specification. HISTORY
The Curses package appeared in 4.0BSD. BSD
August 12, 2002 BSD
All times are GMT -4. The time now is 10:07 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy