Probably lots of ways to do this. You can pipe the output of a find command through this small awk which will generate the mv commands.
You can then pipe the output through your favorite shell to actually execute the moves (verify that they look good, and no undesired file is being affected. It's generic so it will handle any suffix (.jpg, .png, etc.). It does assume that in the bag of words in the middle, the last word and the number are separated by a space.
Hi I'm new to this. I need to cut off the last 10 digits from a line.
I've used awk {'print $4'} filename.txt | cut -c 32-42 but this does not guarantee only the last 10 characters.
Please help. Thanks.
Sara (4 Replies)
I want to check the argument in KSH. If the user type in the prompt 'find 3' it will format 3 to 003 to match the data in the text file. Same as with 10 to 010. Always begins with 0.
eg.
>find 3
Output:
003
>find 30
Output:
030 (7 Replies)
Hi Folks
Probably an easy one here but how do I get a sequence to get used as mentioned. For example in the following I want to automatically create files that have a 2 digit number at the end of their names:
m@pyhead:~$ for x in $(seq 00 10); do touch file_$x; done
m@pyhead:~$ ls file*... (2 Replies)
Hi,
I just need to check whether number of digits in a phone number is 10 or not. If I am not wrong regex will be: {9}
I have to use this inside nawk as this is a small portion of a big program.
nawk '
BEGIN { RS="";FS=";";
regex="{9}";
}
{
for (i=1;i<=NF;i++) {
if... (6 Replies)
I need to extract all sequences of thirteen digits in a file, e.g. 4384976350232, and at the same time not extract sequences with 14 or more digits.
How do I do that using sed, awk or something built into bash? (8 Replies)
Using these strings as an example:
<a onclick="doShowCHys=1;ShowWindowN(0,'/daman/man.php?asv4=145148&playTogether=True',960,540,943437);return false;" title="">
<a onclick="doShowCHys=1;ShowWindowN(0,'/daman/man.php?asv4=1451486&playTogether=True',960,540,94343);return false;" title="">
<a... (12 Replies)
Hi All ,
I am having an input file as stated below
5728 U_TOP_LOGIC/U_CM0P/core/u_cortexm0plus/u_top/u_sys/u_core/r03_q_reg_20_/Q 011
611 U_TOP_LOGIC/U_CM0P/core/u_cortexm0plus/u_top/u_sys/u_core/r04_q_reg_20_/Q 011
3486... (4 Replies)
Discussion started by: kshitij
4 Replies
LEARN ABOUT PLAN9
el
el(1) General Commands Manual el(1)NAME
el -- program to make a tuned shell-command for Oneliner
SYNOPSIS
el [-acdfhioxV] [--command cmd] [--args n] [--format fmt] [--execute] [--inpipe buf] [--outpipe buf] [--serial] [--help] [--ver-
sion] [--debug]
DESCRIPTION
This manual page documents briefly the el command.
This manual page was written for the Debian distribution because the original program does not have a manual page. Instead, it has docu-
mentation in the GNU Info format; see below.
el is a program that You can make a tuned shell-command for Oneliner with. This command can send S-exp to Emacs, and this can make Emacs
evaluate it, too. In other words, you can execute Emacs's function from shell-commands. And you can make Emacs work in closer cooperation
with your favorite shell-commands.
OPTIONS
These programs follow the usual GNU command line syntax, with long options starting with two dashes (`-'). A summary of options is
included below. For a complete description, see the Info files.
-c cmd --command cmd
cmd means a function of Elisp. Command line arguments and data from stdin means arguments of cmd. If you specify the only -c
switch, el output one S-exp by one line of stdin.
--a n --args n
Specifies the maximum number of arguments of a Elisp function with -c switch.
-f fmt --format fmt
Allows you to use format string of printf for making a S-exp.
-x--execute
Requests to Oneliner to evaluate the S-exp to use *Oneliner auto-eval* buffer.
-i buf --inpipe buf
Gets input from pipe-buffer. You can specify a number of pipe-buffer, too.
-o buf --outpipe buf
Puts output to pipe-buffer. You can specify a number of pipe-buffer, too.
-s--serial
Makes el to serialize multiple lines to one line.
-h--help
Display help message.
-V--version
Display version identifiers.
-d--debug
Enable debugging state.
SEE ALSO
The programs are documented fully by Oneliner(Shell-mode hooks for Oneliners) available via the Info system.
AUTHOR
This manual page was written by OHURA Makoto <ohura@debian.org> for the Debian system (but may be used by others). Permission is granted
to copy, distribute and/or modify this document under the terms of the GNU General Public License, Version 2 any later version published by
the Free Software Foundation.
On Debian systems, the complete text of the GNU General Public License can be found in /usr/share/common-licenses/GPL.
el(1)