Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Insert date/time within a filename Post 88615 by vgersh99 on Monday 7th of November 2005 09:27:10 AM
Old 11-07-2005
here's a "pure" ksh:
Code:
#!/bin/ksh

for iter in  firstjd secondjo thirdjv
do
   _time=$(date +%Y%m%d-%H%M%S)
   root="${iter%%??}"
   suf="${iter##${root}}"
   echo "old->[${iter}] new->[${root}${_time}${suf}]"
done

 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Renaming files to have date/time in filename

I have a program that will export my data to a single file, but it assigns a file name that is overridden every time I run the program. I need to change the file name to have a sequential number in the filename. How do I rename a file so that the filename contains the system date and time. I want... (5 Replies)
Discussion started by: wayneb
5 Replies

2. Shell Programming and Scripting

Insert Time and Date Stamp

I have a directory with following files in it ABC.000.DAT ABC.001.DAT ABC.002.DAT ABC.003.DAT I want to insert time and date stamp in file names like ABC.000.YYYYMMDDHHMM.DAT I able to insert the time and date stamp at the end of filename Kindly help (1 Reply)
Discussion started by: aajmani
1 Replies

3. UNIX for Advanced & Expert Users

find formatted filename with date time

Hi, I operate and use HF radars along the California coast for ocean surface currents. The devices use Mac OS as the control and logging software. The software generates thousands of files a week and while I've used PERL in the past to solve the problems of finding files I come to realize some... (6 Replies)
Discussion started by: dpath2o
6 Replies

4. UNIX for Dummies Questions & Answers

Shell Scripts - Append a filename with date and time....

Hello, I need to create a shell script that appends a filename to create a name with the date and time appended that is guaranteed to not exist. That is, the script insures you will not overwrite a file with the same name. I am lost with this one. I know I need to use date but after that I am... (3 Replies)
Discussion started by: citizencro
3 Replies

5. Shell Programming and Scripting

append a filename with system date and time

Hi, There are similar kind of posts, but none seems like working for me. Please correct me if I'm wrong. I need append/rename file abc.txt with file processed date and time like abc_systemdatetimestamp.txt and move it to different folder. for example I have /source/data/abc.txt ... (1 Reply)
Discussion started by: amsn08
1 Replies

6. Shell Programming and Scripting

Insert date/time in reoccurring blocks of lines

Hi folks, I have a little problem, that is kinda bugging me :( ... I have a logfile, that looks kinda "crippled" in the raw format ... So far, I've managed, to get it in a format like this: PRI_PTA01,2W,30,30,0,0,0,0,0,0,0,0,0,0,0,0... (5 Replies)
Discussion started by: whizzler
5 Replies

7. Shell Programming and Scripting

Insert date/time header at top of file

I'm trying to take mrt output and put it at the top of a file along with the date and time. I was able to do it at the bottom of the file with the following printf "********** $(date) **********\n\n" >> $OUTPUT_PATH/$HOSTNAME mtr -r -w -c 10 $HOSTADDRESS >> $OUTPUT_PATH/$HOSTNAME printf... (2 Replies)
Discussion started by: kramer65
2 Replies

8. Shell Programming and Scripting

Validate date and time in filename by awk

hi i want to validate the date and time in filename filename : mohan.moh.ccyymmdd.ccyymmdd.hhmmss.txt mohan_moh.20151222.20151222.122442.txt i want code that check that date given in filename 20151222 in this format ccyymmdd else it mark file is not valid used in my OS detail is AIX 6... (12 Replies)
Discussion started by: MOHANP12
12 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
Gtk2::TextIter(3)					User Contributed Perl Documentation					 Gtk2::TextIter(3)

NAME
Gtk2::TextIter HIERARCHY
Glib::Boxed +----Gtk2::TextIter METHODS
textattributes = $iter->get_attributes boolean = $iter->backward_char boolean = $iter->backward_chars ($count) o $count (integer) boolean = $iter->backward_cursor_position boolean = $iter->backward_cursor_positions ($count) o $count (integer) boolean = $iter->backward_find_char ($pred, $user_data=undef, $limit=undef) o $pred (scalar) o $user_data (scalar) o $limit (Gtk2::TextIter or undef) boolean = $iter->backward_line boolean = $iter->backward_lines ($count) o $count (integer) (match_start, match_end) = $iter->forward_search ($str, $flags, $limit=NULL) o $str (string) o $flags (Gtk2::TextSearchFlags) o $limit (Gtk2::TextIter or undef) boolean = $iter->backward_sentence_start boolean = $iter->backward_sentence_starts ($count) o $count (integer) boolean = $iter->backward_to_tag_toggle ($tag) o $tag (Gtk2::TextTag or undef) boolean = $iter->backward_visible_cursor_position Since: gtk+ 2.4 boolean = $iter->backward_visible_cursor_positions ($count) o $count (integer) Since: gtk+ 2.4 boolean = $iter->backward_visible_line Since: gtk+ 2.8 boolean = $iter->backward_visible_lines ($count) o $count (integer) Since: gtk+ 2.8 boolean = $iter->backward_visible_word_start Since: gtk+ 2.4 boolean = $iter->backward_visible_word_starts ($count) o $count (integer) Since: gtk+ 2.4 boolean = $iter->backward_word_start boolean = $iter->backward_word_starts ($count) o $count (integer) boolean = $iter->begins_tag ($tag) o $tag (Gtk2::TextTag or undef) textbuffer = $iter->get_buffer integer = $iter->get_bytes_in_line boolean = $iter->can_insert ($default_editability) o $default_editability (boolean) character = $iter->get_char integer = $iter->get_chars_in_line textchildanchor or undef = $iter->get_child_anchor integer = $lhs->compare ($rhs) o $rhs (Gtk2::TextIter) boolean = $iter->editable ($default_setting) o $default_setting (boolean) boolean = $iter->ends_line boolean = $iter->ends_sentence boolean = $iter->ends_tag ($tag) o $tag (Gtk2::TextTag or undef) boolean = $iter->ends_word boolean = $lhs->equal ($rhs) o $rhs (Gtk2::TextIter) boolean = $iter->forward_char boolean = $iter->forward_chars ($count) o $count (integer) boolean = $iter->forward_cursor_position boolean = $iter->forward_cursor_positions ($count) o $count (integer) boolean = $iter->forward_find_char ($pred, $user_data=undef, $limit=undef) o $pred (scalar) o $user_data (scalar) o $limit (Gtk2::TextIter or undef) boolean = $iter->forward_line boolean = $iter->forward_lines ($count) o $count (integer) (match_start, match_end) = $iter->forward_search ($str, $flags, $limit=NULL) o $str (string) o $flags (Gtk2::TextSearchFlags) o $limit (Gtk2::TextIter or undef) boolean = $iter->forward_sentence_end boolean = $iter->forward_sentence_ends ($count) o $count (integer) $iter->forward_to_end boolean = $iter->forward_to_line_end boolean = $iter->forward_to_tag_toggle ($tag) o $tag (Gtk2::TextTag or undef) boolean = $iter->forward_visible_cursor_position Since: gtk+ 2.4 boolean = $iter->forward_visible_cursor_positions ($count) o $count (integer) Since: gtk+ 2.4 boolean = $iter->forward_visible_line Since: gtk+ 2.8 boolean = $iter->forward_visible_lines ($count) o $count (integer) Since: gtk+ 2.8 boolean = $iter->forward_visible_word_end Since: gtk+ 2.4 boolean = $iter->forward_visible_word_ends ($count) o $count (integer) Since: gtk+ 2.4 boolean = $iter->forward_word_end boolean = $iter->forward_word_ends ($count) o $count (integer) boolean = $iter->has_tag ($tag) o $tag (Gtk2::TextTag) boolean = $iter->in_range ($start, $end) o $start (Gtk2::TextIter) o $end (Gtk2::TextIter) boolean = $iter->inside_sentence boolean = $iter->inside_word boolean = $iter->is_cursor_position boolean = $iter->is_end boolean = $iter->is_start language = $iter->get_language integer = $iter->get_line integer = $iter->get_line_index $iter->set_line_index ($byte_on_line) o $byte_on_line (integer) integer = $iter->get_line_offset $iter->set_line_offset ($char_on_line) o $char_on_line (integer) $iter->set_line ($line_number) o $line_number (integer) list = $iter->get_marks Returns a list of all Gtk2::TextMark at this location. Because marks are not iterable (they don't take up any "space" in the buffer, they are just marks in between iterable locations), multiple marks can exist in the same place. The returned list is not in any meaningful order. integer = $iter->get_offset $iter->set_offset ($char_offset) o $char_offset (integer) $first->order ($second) o $second (Gtk2::TextIter) pixbuf or undef = $iter->get_pixbuf string = $start->get_slice ($end) o $end (Gtk2::TextIter) boolean = $iter->starts_line boolean = $iter->starts_sentence boolean = $iter->starts_word list = $iter->get_tags Returns a list of tags that apply to iter, in ascending order of priority (highest-priority tags are last). string = $start->get_text ($end) o $end (Gtk2::TextIter) list = $iter->get_toggled_tags ($toggled_on) o $toggled_on (boolean) Returns a list of Gtk2::TextTag that are toggled on or off at this point. (If toggled_on is TRUE, the list contains tags that are toggled on.) If a tag is toggled on at iter, then some non-empty range of characters following iter has that tag applied to it. If a tag is toggled off, then some non-empty range following iter does not have the tag applied to it. boolean = $iter->toggles_tag ($tag) o $tag (Gtk2::TextTag or undef) integer = $iter->get_visible_line_index $iter->set_visible_line_index ($byte_on_line) o $byte_on_line (integer) integer = $iter->get_visible_line_offset $iter->set_visible_line_offset ($char_on_line) o $char_on_line (integer) string = $start->get_visible_slice ($end) o $end (Gtk2::TextIter) string = $start->get_visible_text ($end) o $end (Gtk2::TextIter) ENUMS AND FLAGS
flags Gtk2::TextSearchFlags o 'visible-only' / 'GTK_TEXT_SEARCH_VISIBLE_ONLY' o 'text-only' / 'GTK_TEXT_SEARCH_TEXT_ONLY' SEE ALSO
Gtk2, Glib::Boxed COPYRIGHT
Copyright (C) 2003-2008 by the gtk2-perl team. This software is licensed under the LGPL. See Gtk2 for a full notice. perl v5.12.1 2010-07-05 Gtk2::TextIter(3)
All times are GMT -4. The time now is 09:57 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy