i have hundreds of directories that have to be renamed. the directory structure is fairly uniform which makes the scripting a little simpler.
suppose i have many directories like this */*/*/*abc* (in other words i have similar directory names 3 dirs deep that all contain the pattern abc in... (8 Replies)
I need to split a file based on certain context inside the file. Is there a unix command that can do this? I have looked into split and csplit but it does not seem like those would work because I need to split this file based on certain text. The file has multiple records and I need to split this... (1 Reply)
Hi,
I have some ps files where I want to ectract/copy a certain number from and use that number to rename the ps file.
eg:
'file.ps' contains following text:
14 (09 01 932688 0)t
the text can be variable, the only fixed element is the '14 ('. The problem is that the fixed element can appear... (7 Replies)
Evening all. I'm having a terrible time with a script I've been working on for a few days now...
Say I have a text file named top10song.tm2, with the following in it:
kernkraft 400
Imagine
i kissed a girl
Thriller
animals
hallelujah
paint it black
psychosocial
Oi to the world... (14 Replies)
Hi,
I'm not very experienced in shell scripting and that's probably why I came across the following problem:
I do have several hundred pairs of text files (PF00x.spl and PF00x.shd) where the first file (PF00x.spl) needs to be renamed according a string that is included in the second file... (12 Replies)
I have a number of files in directories labeled like this:
/Data/tr_gray/tr_DTI/dti_FA.nii.gz
(the brackets here represent a range of number that the files are labeled with)
I need to rename each dti_FA.nii.gz file according to the name of the folder it resides in. For example, the file ... (3 Replies)
Hello,
I have a file ff.txt that looks as follows
*ABNA.txt
356
24
36
112
*AC24.txt
457
458
321
2
ABNA.txt and AC24.txt are the files in the folder named foo1. Based on the numbers in the ff.txt file, I want to extract the lines from the corresponding files in the foo1 folder and... (2 Replies)
I have files in the ABC_YYYYMMDD.zip format under a directory. Each zip file contains A text file in the ABC_YYYYMMDD.txt format.
I am trying to create a script that will Rename the zip files and their underlying text file replacing the datepart in them with .
For eg: in the case of... (1 Reply)
Hi,
I have a directory with a lot of files like this:
a.bam
b.bam
c.bam
I like to rename these files based on a list where the name of the files in the first column will be replasced by the names in the second column. Here is my list which is a tab-delimited text file:
a x
b y
c ... (4 Replies)
Hello, I have a text file "file.list" with the contents below.
file1
filename1
file2
filename2
file3
filename3
file1, file2 and file3 are files existing in the same directory as the text file file.list.
I want to rename file1 to filename1, file2 to filename2, as show in the text... (1 Reply)
Discussion started by: james2009
1 Replies
LEARN ABOUT SUSE
textutil_string
textutil::string(n) Text and string utilities, macro processing textutil::string(n)
__________________________________________________________________________________________________________________________________________________NAME
textutil::string - Procedures to manipulate texts and strings.
SYNOPSIS
package require Tcl 8.2
package require textutil::string ?0.7?
::textutil::string::chop string
::textutil::string::tail string
::textutil::string::cap string
::textutil::string::uncap string
::textutil::string::longestCommonPrefixList list
::textutil::string::longestCommonPrefix ?string...?
_________________________________________________________________DESCRIPTION
The package textutil::string provides miscellaneous string manipulation commands.
The complete set of procedures is described below.
::textutil::string::chop string
A convenience command. Removes the last character of string and returns the shortened string.
::textutil::string::tail string
A convenience command. Removes the first character of string and returns the shortened string.
::textutil::string::cap string
Capitalizes the first character of string and returns the modified string.
::textutil::string::uncap string
The complementary operation to ::textutil::string::cap. Forces the first character of string to lower case and returns the modified
string.
::textutil::string::longestCommonPrefixList list
::textutil::string::longestCommonPrefix ?string...?
Computes the longest common prefix for either the strings given to the command, or the strings specified in the single list, and
returns it as the result of the command.
If no strings were specified the result is the empty string. If only one string was specified, the string itself is returned, as it
is its own longest common prefix.
BUGS, IDEAS, FEEDBACK
This document, and the package it describes, will undoubtedly contain bugs and other problems. Please report such in the category textutil
of the Tcllib SF Trackers [http://sourceforge.net/tracker/?group_id=12883]. Please also report any ideas for enhancements you may have for
either package and/or documentation.
SEE ALSO
regexp(n), split(n), string(n)
KEYWORDS
capitalize, chop, common prefix, formatting, prefix, string, uncapitalize
textutil 0.7 textutil::string(n)