Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Extract Date part from the filename Post 302895549 by RudiC on Tuesday 1st of April 2014 09:17:03 AM
Old 04-01-2014
Where or how do you have the file name (variable, ls output, text file)?
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

part of a filename

Hi, I need to extract only a part of the filenames of some files. The files are named this way : .tap_profile_SIT02 I want the "SIT02" part, which is not the same for each file. I was able to get what I want with bash, but not with ksh. Here is the command I used in bash : find... (8 Replies)
Discussion started by: flame_eagle
8 Replies

2. Shell Programming and Scripting

Extract date from filename and create a new file

Hi, i have a filename CRED20102009.txt in a server 20102009 is the date of the file ddmmaaaa format the complete route is /dprod/informatica/Fuentes/CRED20102009.csv i want to extract the date to create a new file named Parameters.txt I need to create Parameters.txt with this... (6 Replies)
Discussion started by: angel1001
6 Replies

3. Shell Programming and Scripting

Extract date from filename and set timestamp

I have lots of files in this format: dvgrab-2003.06.29_15-30-24.mpg The numbers represents the date and time (YYYY.MM.DD_HH-MM-SS) How can I extract the dates from the filenames, and use the dates in the file timestamp? I guess this can be done by using "find", "sed" and "touch"? Can... (6 Replies)
Discussion started by: qwerty1234
6 Replies

4. Shell Programming and Scripting

Getting part of a filename

Hi All, I'm trying to get part of a filename and my skill with regular expression are lacking. I know I need to use SED but have no idea how to use it. I'm hoping that someone can help me out. The file names would be: prefix<partwewant>suffix.extension the prefix and suffix are always 3... (4 Replies)
Discussion started by: imonkey
4 Replies

5. UNIX for Dummies Questions & Answers

to extract all the part of the filename before a particular word in the filename

Hi All, Thanks in Advance I am working on a shell script. I need some assistance. My Requirement: 1) There are some set of files in a directory like given below OTP_UFSC_20120530000000_acc.csv OTP_UFSC_20120530000000_faf.csv OTP_UFSC_20120530000000_prom.csv... (0 Replies)
Discussion started by: aealexanderraj
0 Replies

6. Programming

to extract all the part of the filename before a particular word in the filename

Hi All, Thanks in Advance I am working on a shell script. I need some assistance. My code: if then set "subscriber" "promplan" "mapping" "dedicatedaccount" "faflistSub" "faflistAcc" "accumulator"\ "pam_account"; for i in 1 2 3 4 5 6 7 8;... (0 Replies)
Discussion started by: aealexanderraj
0 Replies

7. Shell Programming and Scripting

Extract a part of a filename containing a particular word

Hi All, Thanks in Advance Shell Script or Perl Script I am working on a shell script. I need some assistance. My Requirement: 1) There are some set of files in a directory like given below OTP_UFSC_20120530000000_acc.csv OTP_UFSC_20120530000000_faf.csv... (7 Replies)
Discussion started by: aealexanderraj
7 Replies

8. Shell Programming and Scripting

Finding the part of a filename

Hi, I am writing an ebuild for Gentoo Linux operating system. Writing an ebuild is about Bash scripting where I am a newbie. So, my ebuild must find a part of a specific filename. Such a filaname my look like this: libvclient_release_x64.so.740and I must to find the number at the and of... (18 Replies)
Discussion started by: csanyipal
18 Replies

9. UNIX for Beginners Questions & Answers

How to extract date and time from filename?

Hi, I'm totally new in sell script and working with a shell code. I want to extract the date and time from the filenames. The filenames are different but all of them begins with WI_ SCOPE_: WI_SCOPE_DATA_CHANGE_2017-09-12_15-30-40.txt WI_SCOPE_BACK_COMPLETE_QUEUE_2017-09-12_15-31-40.txt... (5 Replies)
Discussion started by: Home
5 Replies

10. UNIX for Beginners Questions & Answers

Extract date and time part from filename

Hi, I am facing one scenario in which I need to extract exact position of date and time from the name of the files. For example, Below is the record in which I need to extract position of YYYYMMDD,HHMISS and YYMMDD. Date and time variables can come more than once. I need to use these position... (13 Replies)
Discussion started by: Prathmesh
13 Replies
PMPRINTF(3)						     Library Functions Manual						       PMPRINTF(3)

NAME
pmprintf, pmflush - print formatted output in a window or to standard error C SYNOPSIS
#include <pcp/pmapi.h> int pmprintf(const char *fmt, ... /*args*/); int pmflush(void); cc ... -lpcp DESCRIPTION
The combination of pmprintf and pmflush produces output in either an xconfirm(1) window, on the standard error stream, or to a file in a manner similar to fprintf(3). The fmt argument is used to control the conversion, formatting, and printing of the variable length args list. The output technique is controlled via an environment variable. pmprintf appends the formatted message string to an internal buffer shared by the two routines, without actually producing any output. pmflush causes the internal buffer to be either displayed in a window, printed on standard error, or flushed to a file and the internal buffer to be cleared. ENVIRONMENT
The environment variable PCP_STDERR controls the output technique used by pmflush: If PCP_STDERR is unset, the text is written onto the stderr stream of the caller. If PCP_STDERR is set to the literal reserved word DISPLAY then the text will be displayed as a GUI dialog using xconfirm(1). If PCP_STDERR is set to any other value then pmflush interprets the value as a file name and appends the text to that file. The file is created if it doesn't already exist, and in this case if the file creation fails, then stderr is used instead). FILES
pmprintf uses the mkstemp(3) function to create a temporary file. This temporary file is deleted when pmflush is called. DIAGNOSTICS
On successful completion, pmprintf returns the number of characters transmitted, while pmflush returns a value of zero on successful com- pletion. For either routine, a negative value is returned if an error was encountered, and this can be passed to pmErrStr(3) to obtain the associ- ated error message. SEE ALSO
pmdbg(1), fprintf(3), mkstemp(3), pmErrStr(3) and PMAPI(3). Performance Co-Pilot PCP PMPRINTF(3)
All times are GMT -4. The time now is 07:54 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy