Sponsored Content
Top Forums Shell Programming and Scripting How do you move lines of numbers based on the month Post 302204410 by terryporter51 on Wednesday 11th of June 2008 01:00:16 PM
Old 06-11-2008
How do you move lines of numbers based on the month

How do you move lines of numbers i.e.(131, 134, 116, etc...) based on the month? Say for instance I only wanted June numbers and not July. This is what the file looks like so far but it runs everyday in a cron job so it will build to July.

#cat backupcount.log
131 ,Thu Jun 05 08:00:41 2008
134 ,Fri Jun 06 09:41:39 2008
116 ,Sat Jun 07 08:15:24 2008
106 ,Sun Jun 08 08:15:23 2008
95 ,Mon Jun 09 08:15:23 2008
117 ,Tue Jun 10 08:15:42 2008
140 ,Wed Jun 11 08:15:37 2008

I guess my problem is how do you move or copy based on the month. I thought about -mtime in relation to +30 days but some months have 28 and 31 days. How can I differentiate based on the month? Smilie
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How to fetch rows based on line numbers or based on the beginning of a word?

I have a file which will have rows like shown below, ST*820*316054716 RMR*IV*11333331009*PO*40.31 REF*IV*22234441009*xsss471-2762 DTM*003*091016 ENT*000006 RMR*IV*2222234444*PO*239.91 REF*IV*1234445451009*LJhjlkhkj471-2762 </SPAN> DTM*003* 091016 RMR*IV*2223344441009*PO*40.31... (18 Replies)
Discussion started by: Muthuraj K
18 Replies

2. Shell Programming and Scripting

How to extract log info based on last month?

Hi Gurus I'm using HPUX B.11.23 ia64, the below sample log data was extracted from HPUX commnad: last -R. Sample data: root pts/ta userpc Wed Aug 11 09:46 - 20:21 (10:35) root pts/ta userpc Wed Aug 11 09:44 - 20:10 (10:34) root pts/ta userpc Wed Aug 11... (4 Replies)
Discussion started by: superHonda123
4 Replies

3. Shell Programming and Scripting

Move File Every Last Date of the Month

Dear experts, I have a file named "GI_GR.csv" generated by SAP everyday. What I need is every last date of the month ( Jan 31, Feb 28/29, Mar 31, etc), the file is copied to subfolder named "archive" and rename it to "GI_GR_Jan.csv" for January and so on. What I want to ask is, how to check if... (8 Replies)
Discussion started by: kris.adrianto
8 Replies

4. Solaris

Move files into different folders based on its month

Hi All, I want to move the files in to different folders based on the files month in the file timestamp. For example All the september files in the directory should moves into the folder "sep_bkp_files" , August files in to aug_bkp_files folder... Please help me to achive the above... (10 Replies)
Discussion started by: velava
10 Replies

5. UNIX for Dummies Questions & Answers

Extracting lines from a text file based on another text file with line numbers

Hi, I am trying to extract lines from a text file given a text file containing line numbers to be extracted from the first file. How do I go about doing this? Thanks! (1 Reply)
Discussion started by: evelibertine
1 Replies

6. Shell Programming and Scripting

Extracting lines from text files in folder based on the numbers in another file

Hello, I have a file ff.txt that looks as follows *ABNA.txt 356 24 36 112 *AC24.txt 457 458 321 2 ABNA.txt and AC24.txt are the files in the folder named foo1. Based on the numbers in the ff.txt file, I want to extract the lines from the corresponding files in the foo1 folder and... (2 Replies)
Discussion started by: mohamad
2 Replies

7. Shell Programming and Scripting

Last date of month based on parameter

Hi All, How do i get the last date of a month in Unix based on a parameter value. My requirement is if i pass 03/05/2014 as parameter, then i shud get the output/return value as 2/28/2014 If i pass 03/31/2014 as parameter, the output/return value should be 03/31/2014 itself. Also,... (2 Replies)
Discussion started by: galaxy_rocky
2 Replies

8. Shell Programming and Scripting

Fetch files based on month

Hi All I have a requirement like below.I have always 12 files got generated in my directory called /xx/out/ abc_2014_10_121.xml abc_2014_09_345.xml abc_2014_08_432.xml abc_2014_07_123.xml abc_2014_06_098.xml abc_2014_05_569.xml abc_2014_04_430.xml abc_2014_03_235.xml abc_2014_02_056.xml... (9 Replies)
Discussion started by: chigurupati.dwh
9 Replies

9. UNIX for Dummies Questions & Answers

awk - (URGENT!) Print lines sort and move lines if match found

URGENT HELP IS NEEDED!! I am looking to move matching lines (01 - 07) from File1 and 77 tab the matching string from File2, to File3.txt. I am almost done but - Currently, script is not printing lines to File3.txt in order. - Also the matching lines are not moving out of File1.txt ... (1 Reply)
Discussion started by: High-T
1 Replies

10. UNIX for Dummies Questions & Answers

Need script to move files based on month

Hi , I need a script which moves files based on month. Example : Apr 29 03:16 log4.txt Apr 29 03:16 log5.txt May 4 09:17 log1.txt May 4 09:17 log2.txt Move Apr files into Apr2015(Folder) Move May files into May2015(Folder). This is urgent requirement , if you can help me... (5 Replies)
Discussion started by: rockingvj
5 Replies
curs_scroll(3CURSES)					     Curses Library Functions					      curs_scroll(3CURSES)

NAME
curs_scroll, scroll, scrl, wscrl - scroll a curses window SYNOPSIS
cc [ flag ... ] file ... -lcurses [ library ... ] #include <curses.h> int scroll(WINDOW *win); int scrl(int n); int wscrl(WINDOW *win, int n); DESCRIPTION
With the scroll() routine, the window is scrolled up one line. This involves moving the lines in the window data structure. As an optimiza- tion, if the scrolling region of the window is the entire screen, the physical screen is scrolled at the same time. With the scrl() and wscrl() routines, for positive n 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 VALUES
All routines return the integer ERR upon failure and an integer value other than ERR upon successful completion. ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |MT-Level |Unsafe | +-----------------------------+-----------------------------+ SEE ALSO
curs_outopts(3CURSES), curses(3CURSES), attributes(5) NOTES
The header <curses.h> automatically includes the headers <stdio.h> and <unctrl.h>. Note that scrl() and scroll() may be macros. SunOS 5.10 31 Dec 1996 curs_scroll(3CURSES)
All times are GMT -4. The time now is 06:58 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy