Sponsored Content
Full Discussion: Extracting Date from string
Top Forums Shell Programming and Scripting Extracting Date from string Post 302349077 by cfajohnson on Monday 31st of August 2009 04:46:57 AM
Old 08-31-2009

I repeat: What is the value of "$file"?

I don't want the names of the files; I want the actual value of the variable.

(You do realize that the code I posted was to operate on a single file, don't you? To work on all the .csv files, you need to put it in a loop with all of the file names. Use whatever pattern finds them all.)
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

extracting files using date in ksh

Hi All., 1 ssssss C2052EX 15 Mar 30 19:01 1 aaaaa C2052EX 15 Apr 3 10:12 1 ccccc C2052EX 15 Apr 4 09:28 i have files arriving like above. i am using the following to extract files arriving today ( say apr4) todaydat=`date | cut -c5-10` find... (1 Reply)
Discussion started by: pavan_test
1 Replies

2. Shell Programming and Scripting

Extracting date-time from file.

I have the following file and need to extract date and time part for each record. Pl. could anyone provide an shell script which could be used to do it. Here is the file: /rgrdev/pdsud2/unx/agc/src/agcmst: /rgrsrc/pdspms/unx/agc/src/s.agcmst.for agcmst.for 420.20 8/4/07 18:30:53 ... (7 Replies)
Discussion started by: skumar11
7 Replies

3. Shell Programming and Scripting

Extracting a string from one file and searching the same string in other files

Hi, Need to extract a string from one file and search the same in other files. Ex: I have file1 of hundred lines with no delimiters not even space. I have 3 more files. I should get 1 to 10 characters say substring from each line of file1 and search that string in rest of the files and get... (1 Reply)
Discussion started by: mohancrr
1 Replies

4. Shell Programming and Scripting

Perl: Extracting date from file name and comparing with current date

I need to extract the date part from the file name (20080221 in this ex) and compare it with the current date and delete it, if it is a past date. $file = exp_ABCD4_T-2584780_upto_20080221.dmp.Z really appreciate any help. thanks mkneni (4 Replies)
Discussion started by: MKNENI
4 Replies

5. UNIX for Dummies Questions & Answers

extracting and using date from filenames in a loop

HIya, Having a dumb day whilst writing an archive process in Shell want to extract from the filename the date and archive into tar files based on this, I don't want to use mtime as it may not be the actual file date. The files are -rw-rw---- 1 user admin 100 Aug 29 11:10... (2 Replies)
Discussion started by: badg3r
2 Replies

6. UNIX for Dummies Questions & Answers

extracting date from a filename

Hi, I am a beginner in Unix so please bear with me... I have a directory which has files in format: RECF-YYYY-MM-DD-input. For example, RECF-2008-02-25-input. I need to extract the YYYYY-MM-DD substring from this filename and convert that into date and compare it with a date. How do I do that?... (7 Replies)
Discussion started by: laiko
7 Replies

7. Homework & Coursework Questions

Date comparison with 'string date having slashes and time zone' in Bash only

1. The problem statement, all variables and given/known data: I have standard web server log file. It contains different columns (like IP address, request result code, request type etc) including a date column with the format . I have developed a log analysis command line utility that displays... (1 Reply)
Discussion started by: TariqYousaf
1 Replies

8. Shell Programming and Scripting

Extracting data from two date entries

Hi again: I have this file: "2010-11-1 11:50:00",40894,13.38,17.24,12.92,13.23,"2010-11-14 11:43:02",12.56,"2010-11-14 11:46:02",22.68,20.95,"2010-11-14 11:44:03",2.144,2.078,190.4,14.27,6.293,"2010-11-14 ... (2 Replies)
Discussion started by: iga3725
2 Replies

9. Homework & Coursework Questions

extracting date from log file

You are given a 1 year logfile with each line starting with a date in the form “YYYY-MM-DD”. How would you extract logs from the 4th day of each month and put them into a new file (1 Reply)
Discussion started by: DOkuwa
1 Replies

10. Shell Programming and Scripting

Extracting substring within string between 2 token within the string

Hello. First best wishes for everybody. here is the input file ("$INPUT1") contents : BASH_FUNC_message_begin_script%%=() { local -a L_ARRAY; BASH_FUNC_message_debug%%=() { local -a L_ARRAY; BASH_FUNC_message_end_script%%=() { local -a L_ARRAY; BASH_FUNC_message_error%%=() { local... (3 Replies)
Discussion started by: jcdole
3 Replies
MAN(7)							 Miscellaneous Information Manual						    MAN(7)

NAME
man - macros to typeset manual SYNOPSIS
nroff -man file ... troff -man file ... DESCRIPTION
These macros are used to lay out pages of this manual. A skeleton page may be found in the file /usr/man/man.template. Any text argument t may be zero to six words. Quotes may be used to include blanks in a `word'. If text is empty, special treatment is applied to the next input line with text to be printed. In this way .I may be used to italicize a whole line, or .SM may be followed by .B to make small bold letters. A prevailing indent distance is remembered between successive indented paragraphs, and is reset to default value upon reaching a non- indented paragraph. Default units for indents i are ens. Type font and size are reset to default values before each paragraph, and after processing font and size setting macros. These strings are predefined by -man: *R `(Reg)', trademark symbol in troff. *S Change to default type size. FILES
/usr/share/tmac/tmac.an /usr/man/man.template SEE ALSO
troff(1), man(1) BUGS
Relative indents don't nest. REQUESTS
Request Cause If no Explanation Break Argument .B t no t=n.t.l.*Text t is bold. .BI t no t=n.t.l. Join words of t alternating bold and italic. .BR t no t=n.t.l. Join words of t alternating bold and Roman. .DT no .5i 1i...Restore default tabs. .HP i yes i=p.i.* Set pre- vailing indent to i. Begin paragraph with hanging indent. .I t no t=n.t.l. Text t is italic. .IB t no t=n.t.l. Join words of t alternating italic and bold. .IP x i yes x="" Same as .TP with tag x. .IR t no t=n.t.l. Join words of t alternating italic and Roman. .LP yes - Same as .PP. .PD d no d=.4v Interparagraph distance is d. .PP yes - Begin paragraph. Set prevailing indent to .5i. .RE yes - End of relative indent. Set prevailing indent to amount of starting .RS. .RB t no t=n.t.l. Join words of t alternating Roman and bold. .RI t no t=n.t.l. Join words of t alternating Roman and italic. .RS i yes i=p.i. Start relative indent, move left margin in distance i. Set prevailing indent to .5i for nested indents. .SH t yes t=n.t.l. Subhead. .SM t no t=n.t.l. Text t is small. .TH n c x v m yes -Begin page named n of chapter c; x is extra commentary, e.g. `local', for page foot center; v alters page foot left, e.g. `4th Berkeley Distribution'; m alters page head center, e.g. `Brand X Programmer's Manual'. Set prevailing indent and tabs to .5i. .TP i yes i=p.i. Set prevailing indent to i. Begin indented paragraph with hanging tag given by next text line. If tag doesn't fit, place it on separate line. * n.t.l. = next text line; p.i. = prevailing indent 7th Edition October 22, 1996 MAN(7)
All times are GMT -4. The time now is 10:43 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy