Sponsored Content
Top Forums Shell Programming and Scripting How to retrieve digital string using sed or awk Post 302444554 by victorcheung on Thursday 12th of August 2010 06:20:37 AM
Old 08-12-2010
How to retrieve digital string using sed or awk

Hi,

I have filename in the following format:

YUENLONG_20070818.DMP
HK_20070818_V0.DMP
WANCHAI_20070820.DMP
KWUNTONG_20070820_V0.DMP

How to retrieve only the digital part with sed or awk and return the following format:

20070818
20070818
20070820
20070820


Thanks!
Victor
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

retrieve lines using sed, grep or awk

Hi, I'm looking for a command to retrieve a block of lines using sed or grep, probably awk if that can do the job. In below example, By searching for words "Third line2" i'm expecting to retrieve the full block starting with 'BEGIN' and ending with 'END' of the search. Example: ... (3 Replies)
Discussion started by: learning_linux
3 Replies

2. Shell Programming and Scripting

retrieve string from file

hi, I have write a code to retrive data from each line of a file: sed -e '/^#/d' file.csv | awk '{ printf "TEST,%s:AUX,%s;\n", $0, "'A'"}' > pippo.txt where the input file.csv was like this: 1234 2345 2334 3344 and the output of my code is a file with: TEST,1234:AUX,A;... (7 Replies)
Discussion started by: fafo77
7 Replies

3. Shell Programming and Scripting

sed/awk to retrieve max year in column

I am trying to retrieve that max 'year' in a text file that is delimited by tilde (~). It is the second column and the values may be in Char format (double quoted) and have duplicate values. Please help. (4 Replies)
Discussion started by: CKT_newbie88
4 Replies

4. Shell Programming and Scripting

search string in a file and retrieve 10 lines including string line

Hi Guys, I am trying to write a perl script to search a string "Name" in the file "FILE" and also want to create a new file and push the searched string Name line along with 10 lines following the same. can anyone of you please let me know how to go about it ? (8 Replies)
Discussion started by: sukrish
8 Replies

5. Shell Programming and Scripting

cut, sed, awk too slow to retrieve line - other options?

Hi, I have a script that, basically, has two input files of this type: file1 key1=value1_1_1 key2=value1_2_1 key4=value1_4_1 ... file2 key2=value2_2_1 key2=value2_2_2 key3=value2_3_1 key4=value2_4_1 ... My files are 10k lines big each (approx). The keys are strings that don't... (7 Replies)
Discussion started by: fzd
7 Replies

6. Shell Programming and Scripting

How to retrieve string which does not contain '$'?

Hi, I have a file say file1.ksh. Which has data like: ifile $AI_SERIAL/$FILE.DAT... ofile $AI_SERIAL/feed.dat... My requirement is to find the count of all the lines which does not have $ after /. So i have written the code: grep -w 'AI_SERIAL' file1.ksh | cut -d '/' -f2 | grep... (9 Replies)
Discussion started by: Kamna
9 Replies

7. Shell Programming and Scripting

sed or awk command to replace a string pattern with another string based on position of this string

here is what i want to achieve... consider a file contains below contents. the file size is large about 60mb cat dump.sql INSERT INTO `table1` (`id`, `action`, `date`, `descrip`, `lastModified`) VALUES (1,'Change','2011-05-05 00:00:00','Account Updated','2012-02-10... (10 Replies)
Discussion started by: vivek d r
10 Replies

8. Shell Programming and Scripting

Retrieve information Text/Word from HTML code using awk/sed

awk/sed newbie here. I have a HTML file and from that file and I would like to retrieve a text word. <font face=arial size=-1><li><a href=/value_for_clients/Tokyo/abc_process.txt>abc</a> NDK Version: 4.0 </li> <font face=arial size=-1><li><a... (6 Replies)
Discussion started by: sk2code
6 Replies

9. Shell Programming and Scripting

Replace string in XML file with awk/sed with string from another

Sorry for the long/weird title but I'm stuck on a problem I have. I have this XML file: </member> <member> <name>TransactionID</name> <value><string>123456789123456</string></value> </member> <member> <name>Number</name> ... (9 Replies)
Discussion started by: cozzin
9 Replies

10. Shell Programming and Scripting

Replace string of a file with a string of another file for matches using grep,sed,awk

I have a file comp.pkglist which mention package version and release . In 'version change' and 'release change' line there are two versions 'old' and 'new' Version Change: --> Release Change: --> cat comp.pkglist Package list: nss-util-devel-3.28.4-1.el6_9.x86_64 Version Change: 3.28.4 -->... (1 Reply)
Discussion started by: Paras Pandey
1 Replies
CLOCK(1)						      General Commands Manual							  CLOCK(1)

NAME
clock - display the time in an icon or window SYNOPSIS
clock AVAILABILITY
This command is available with the OpenWindows environment. For information about installing OpenWindows, refer to the OpenWindows Instal- lation and Start-Up Guide. DESCRIPTION
clock is an OpenWindows XView utility that displays the current time in a window or icon. When the window is open, clock can display the time in either analog or digital format. The clock window is scalable in either format. USAGE
When the clock window is open, it has a floating menu from which you can bring up a property window. From this property sheet, you can modify the display of the tool by selecting either the Analog or Digital choice box. Seconds: On the analog version, this selection starts a second hand on the face of the clock. On the digital version, it adds two dig- its to the digital readout. Date: Turns on a date display for both analog and digital versions of clock. BUGS
If you reset the system time, clock will not reflect the new time until you change its window state from open to icon, or vice versa. To reset the system time, see date (1V). The date display does not go well with the round clock face. Occasionally, when clock is uncovered, the face will be visually corrupted. Use the Refresh button from the frame menu to repair. 11 June 1990 CLOCK(1)
All times are GMT -4. The time now is 03:54 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy