Sponsored Content
Full Discussion: Cut particular lines
Top Forums UNIX for Dummies Questions & Answers Cut particular lines Post 302771894 by arul1185 on Friday 22nd of February 2013 04:14:52 AM
Old 02-22-2013
Cut particular lines

All,

I would like to cut all the lines from the log file for the timestamp . I'm not clear about how to apply grep ,awk here.Can you help me on this ?

My logfile:
**********

Code:
Wed Feb 20 03:48:26 2013
Thread 1 advanced to log sequence 400 (LGWR switch)
Thu Feb 21 02:34:23 2013
Starting background process CJQ0
Thu Feb 21 02:34:23 2013
CJQ0 started with pid=14, OS id=29548
Thu Feb 21 03:00:00 2013
Fri Feb 22 03:00:04 2013
Begin automatic SQL Tuning Advisor run for special tuning task  "SYS_AUTO_SQL_TUNING_TASK"

My output should be: - I need Feb21 content here.
*******************
Code:
Thu Feb 21 02:34:23 2013
Starting background process CJQ0
Thu Feb 21 02:34:23 2013
CJQ0 started with pid=14, OS id=29548
Thu Feb 21 03:00:00 2013

Thanks
Arul

Moderator's Comments:
Mod Comment edit by bakunin: when we told you in the rules and in the form with which you opened the thread to use CODE-tags we really meant it. Please do so from now on. It can't be that hard to find the button labeled "CODE", no?

Last edited by bakunin; 02-22-2013 at 03:17 PM..
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

cut a number of lines out of a file

Hi, I have a text file contaning around 150 lines, each line is a hostname. I want to read 4 lines/hostnames and save those 4 lines to a seperate file. say the big file is /files/bigfile and I want to have a lot of files in /files named /files/smallfile.1 , /files/smallfile.2 and so on... ... (1 Reply)
Discussion started by: networkfre@k
1 Replies

2. Shell Programming and Scripting

cut 11 lines from a file

All, I have a file that I want to read, cut 12 lines and direct into a new file, and continue to do this until I reach the EOF. How do I do it? can I use cat or read to do this? the file is formated with repetitive output consisting of these 12 lines date: <Timestamp> dev_id: <device ID>... (7 Replies)
Discussion started by: turk22
7 Replies

3. Shell Programming and Scripting

How reverse cut or read rows of lines

Hi, My records are like this BSC403_JAIN03|3153_TropicalFarm_LIMJM1-3_97| BSC403_JAIN03|3410_PantaiAceh_PCEHM1_4_97| BSC406_BMIN02|1433_JomHebohTV3_COW7M1_11_97| I want to extract the value before _97| This command BSC_ID=`echo $DATA | cut -f5 -d"_"` gives me _97|, 4, 11 and by... (16 Replies)
Discussion started by: doer
16 Replies

4. Shell Programming and Scripting

Cut lines before keyword

Hi, How to cut all lines in file before keyword? from 1 2333214 word ...... some text 2 234343 234234 word ...... some text 3 234324 324 3234 word ...... some text to 1 2333214 2 234343 234234 3 234324 324 3234 (4 Replies)
Discussion started by: Trump
4 Replies

5. Shell Programming and Scripting

Sed or awk cut all lines after word

Hi, sorry for newbie question :confused: can't find how to cut ? from 1000 2000 word some text1.... 100 200 300 word some text2.... 10 20 30 abc word some text3.... to some text1.... some text2.... some text3.... (7 Replies)
Discussion started by: Trump
7 Replies

6. Shell Programming and Scripting

cut lines in a file.

Hi Everyone, I have a file a.txt, inside is Mon Jul 20 00:05:07 2009 12 Mon Jul 20 00:05:08 2009 1 The output should be a.txt, inside is 00:05:07 12 00:05:08 1 My method is `cat a.txt | cut -f4,6 -d' ' > a.txt.tmp;mv -rf a.txt.tmp a.txt`; Is any good way to do this? like perl... (5 Replies)
Discussion started by: jimmy_y
5 Replies

7. UNIX for Dummies Questions & Answers

cut particular lines from a file

how can I cut out partiluar lines like from line 233 to 347 ? any idea? (2 Replies)
Discussion started by: kvok
2 Replies

8. Shell Programming and Scripting

How to cut selected lines from command output

Hi guys, I need to cut the first 12 system processes from the command ps -A. I know that the cut command forms part of the pipeline but can't understand how to cut the first 12 lines and later display them on standard output. Please help! Many thanks, Jared. (3 Replies)
Discussion started by: jjb1989
3 Replies

9. Shell Programming and Scripting

Cut Lines using grep

Hi, I have a SQL script with "create table" and "alter table" statements and I want to cut all the alter table statements from original file (A) and move it to a different file (B). Can you please me the option. Thanks a lot for your time. (3 Replies)
Discussion started by: bhupinder08
3 Replies

10. Shell Programming and Scripting

Cut lines from and to in a textfile

i am having a text file like below rama surya pandu latha singh raja i want to get the new file from 3 to 5 i.e pandu latha singh please help (1 Reply)
Discussion started by: suryanarayana
1 Replies
curs_scroll(3X) 														   curs_scroll(3X)

NAME
scroll, scrl, wscrl - scroll a curses window SYNOPSIS
#include <curses.h> int scroll(WINDOW *win); int scrl(int n); int wscrl(WINDOW *win, int n); DESCRIPTION
The scroll routine scrolls the window up one line. This involves moving the lines in the window data structure. As an optimization, if the scrolling region of the window is the entire screen, the physical screen may be scrolled at the same time. For positive n, the scrl and wscrl routines scroll the window up n lines (line i+n becomes i); otherwise scroll the window down n lines. This involves moving the lines in the window character image structure. The current cursor position is not changed. For these functions to work, scrolling must be enabled via scrollok. RETURN VALUE
These routines return ERR upon failure, and OK (SVr4 only specifies "an integer value other than ERR") upon successful completion. NOTES
Note that scrl and scroll may be macros. The SVr4 documentation says that the optimization of physically scrolling immediately if the scroll region is the entire screen "is" per- formed, not "may be" performed. This implementation deliberately does not guarantee that this will occur, to leave open the possibility of smarter optimization of multiple scroll actions on the next update. Neither the SVr4 nor the XSI documentation specify whether the current attribute or current color-pair of blanks generated by the scroll function is zeroed. Under this implementation it is. PORTABILITY
The XSI Curses standard, Issue 4 describes these functions. SEE ALSO
curses(3X), curs_outopts(3X) curs_scroll(3X)
All times are GMT -4. The time now is 01:40 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy