in the original post means any number of consecutive periods and that any number of those strings in a line should be replaced; not just the 1st occurrence of 1 to 3 periods on a line. If my reading is correct, I believe the following simple revision of pamu's suggestion will yield the desired results:
With the input file:
the output produced is:
This User Gave Thanks to Don Cragun For This Post:
We develop a file in windows and move to unix box as a part of deployment. When we do this, we get ctrl-M(^M) character added to the file. So we need to remove ctrl-M(^M) character from all the files from deployment folder and all subfolders folder. Currently we move to individual folders and... (5 Replies)
Hi,
I need some advise on treating non printable chars over ascii value 126
Case 1 :
On some fields in the text , I need to retiain then 'as-is' and load to a database.I understand it also depends on database codepage.
but i just wanna know how do i ensure it do not change while loading... (1 Reply)
Can any one give me the idea on replacing multiple blank lines with a single blank line?
Please conside it for a file having more than 100 number of characters.
Regards,
Siba (3 Replies)
Hello,
I'm trying to write a method which will return the extension of a file given the file's name, e.g. test.txt should return txt. I'm using C so am limited to char pointers and arrays. Here is the code as I have it:
char* getext(char *file)
{
char *extension;
int i, j;... (5 Replies)
Hi,
I am creating a script to do a find and replace single/multiple lines in a file with any number of lines.
I have written a logic in a script that reads a reference file say "findrep" and populates two variables $FIND and $REPLACE
print $FIND gives
Hi How r $u
Rahul()
Note:... (0 Replies)
Hello,
I have a csv file with "^" as text delimiters and "|" as field delimiters. It's converted from a xls file. One record looks like this:
^Tablete Internet^|Archos|501838|^Tableta Internet ARCHOS 80 G9
...| ...
(more lines)
... "501|838"^|330.00|USD|sl|12|0|Link|^router wireless 150... (10 Replies)
I have a file with multiple lines. From each line I want to get all strings that starts with '+' and ends with '/'. Then I want the strings to be separated by ' + '
Example input:
+$A$/NOUN+At/NSUFF_FEM_PL+K/CASE_INDEF_ACC
Sample output:
$A$ + At + K (20 Replies)
Hi
Am confused with the usage of "sed" command
I want to replace a single line with multiple lines of a file..
eg.,
A file has
Hi, How are you?
I need to replace as
Am fine
What are You doing?
I used the script as
string1="Hi, How are you?"
echo "$string1 is the value"... (4 Replies)
Hi All.
Attached are two files.
I ran a query and have the output as in the file with name "FILEWITHFOURRECORDS.txt "
I didn't want all the spaces between the columns so I squeezed the spaces with the "tr" command and also added a carriage return at the end of every line.
But in two... (3 Replies)
Hi Team,
I have a file a1.txt with data as follows.
dfjakjf...asdfkasj</EnableQuotedIDs><SQL><SelectStatement modified='1' type='string'><!
The delimiter string: <SelectStatement modified='1' type='string'><!
dlm="<SelectStatement modified='1' type='string'><!
The above command is... (7 Replies)
Discussion started by: kmanivan82
7 Replies
LEARN ABOUT XFREE86
xtfindfile
XtFindFile(3Xt) XT FUNCTIONS XtFindFile(3Xt)NAME
XtFindFile - search for a file using substitutions in the path list
SYNTAX
String XtFindFile(String path, Substitution substitutions, Cardinal num_substitutions, XtFilePredicate predicate);
ARGUMENTS
path Specifies a path of file names, including substitution characters.
substitutions
Specifies a list of substitutions to make into a path.
num_substitutions
Specifies the number of substitutions passed in.
predicate Specifies a procedure to call to judge a potential file name, or NULL.
DESCRIPTION
The path parameter specifies a string that consists of a series of potential file names delimited by colons. Within each name, the percent
character specifies a string substitution selected by the following character. The character sequence ``%:'' specifies an embedded colon
that is not a delimiter; the sequence is replaced by a single colon. The character sequence ``%%'' specifies a percent character that does
not introduce a substitution; the sequence is replaced by a single percent character. If a percent character is followed by any other
character, XtFindFile looks through the specified substitutions for that character in the match field and if found replaces the percent and
match characters with the string in the corresponding substitution field. A substitution field entry of NULL is equivalent to a pointer to
an empty string. If the operating system does not interpret multiple embedded name separators in the path (i.e., ``/'' in POSIX) the same
way as a single separator, XtFindFile will collapse multiple separators into a single one after performing all string substitutions.
Except for collapsing embedded separators, the contents of the string substitutions are not interpreted by XtFindFile and may therefore
contain any operating-system-dependent characters, including additional name separators. Each resulting string is passed to the predicate
procedure until a string is found for which the procedure returns True; this string is the return value for XtFindFile. If no string
yields a True return from the predicate, XtFindFile returns NULL.
If the predicate parameter is NULL, an internal procedure that checks if the file exists, is readable, and is not a directory will be used.
It is the responsibility of the caller to free the returned string using XtFree when it is no longer needed.
SEE ALSO
X Toolkit Intrinsics - C Language Interface
Xlib - C Language X Interface
XFree86 Version 4.7.0 XtFindFile(3Xt)