Hi,
I have several files with data that have to be imported to a database. These files contain records with separator characters. Some records are corrupt (2 separators are missing) and I need to correct them prior to importing them into the db.
Example:
... (5 Replies)
Hello All,
How to replace a string in nth line of a file using sed or awk.
For Ex: test.txt
Line 1 : TEST1 TEST2 TEST3
Line 2 : TEST1 TEST2 TEST3 TEST4
Line 3 : TEST1 TEST2 TEST3 TEST5
Line 4 : TEST1 TEST2 TEST3 TEST6
Line 5 : TEST1 TEST2 TEST3 TEST7
i want to go to 4th line of a... (1 Reply)
Hi
My input file is like this for eg:
abc abc abc abc abc abc
i would like to replace "abc" with "cba" where the occurrence is divisible by 2
of eg here 2nd, 4th and 6th occurence shud be replace
can anyone suggest in awk or sed (11 Replies)
Hi
I have requirement to find nth occurrence in a file and capture data from with in lines (between lines)
Data in File.
<QUOTE>
<SESSION>
<ATTRIBUTE NAME='Parameter Filename' VALUE='file1.parm'/>
<ATTRIBUTE NAME='Service Name' VALUE='None'/>
</SESSION>
<SESSION>
<ATTRIBUTE... (6 Replies)
Greetings experts. Searched the forums (perhaps not hard enough?) - Am searching for a method to capture all output from a log file following the nth occurrence of a known string.
Background:
Using bash, I want to monitor my Oracle DB alert log file. The script will count the total # of... (2 Replies)
Hi,
I am getting crazy after days on looking at it:
Bash in Ubuntu 12.04.1
I want to do this:
pattern="system /path1/file1 file1"
new_pattern=" data /path2/file2 file2"
file to edit: data.db
- I need to search in the file data.db for the nth occurrence of pattern
- pattern must... (14 Replies)
Please can someone help with this?
I have a file with lines as follows:
word1 word2 word3 word4 word5 word6 word7 word8
word1 word2 word3 word4 word5 word6 word7 word8
word1 word2 word3 word4 word5 word6 word7 word8
word1 word2 word3 word4 word5 word6 word7 word8
When I use the... (7 Replies)
Hi,
I would like to know how, using sed, be able to insert contents of file2 in file1 after say the second occurrence of a given string? e.g.
> cat file1
banana
apple
orange
apple
banana
pear
tangerine
apple
> cat file2
I don't like apples
What would be the sed command to insert... (5 Replies)
Hi All,
I am very new to shell scripting and tried to search this in the forum but no luck.
Requirment:
I have an input file which is comma separated. I need to replace the value in 4th column with another value. This has to happen for all the lines in the file.
Sample data:
Input... (2 Replies)
Hello,
Below command trims right after the nth occurrence of a string.
When I try in while loop, it is not working.
In Terminal
IFS=/ ; read -ra val < Textfile ; echo "${val:0:3}"
It gives only one line:
sunday/monday/tuesday
Textfile:
sunday/monday/tuesday/wednesday/thursday... (2 Replies)
Discussion started by: baris35
2 Replies
LEARN ABOUT HPUX
tt_message_abstainer
tt_message_abstainer(library call) tt_message_abstainer(library call)
NAME
tt_message_abstainer -- return offer's nth abstaining procid
SYNOPSIS
#include <Tt/tt_c.h>
char *tt_message_abstainer(
Tt_message m,
int n);
DESCRIPTION
The tt_message_abstainer function returns the procid of the nth abstainer of the specified message.
The m argument is the opaque handle for the message involved in this operation. The n argument is the number of the abstainer to be
returned. The first abstainer is numbered zero.
RETURN VALUE
Upon successful completion, the tt_message_abstainer function returns the procid of the nth abstainer. The application can use
tt_ptr_error to extract one of the following Tt_status values from the returned pointer:
TT_OK The operation completed successfully.
TT_ERR_PROCID
There is no valid default procid, perhaps because tt_open has not yet been called.
TT_ERR_NUM
The integer value passed was invalid (out of range).
TT_ERR_STATE
The specified message is not in state TT_RETURNED. Since only TT_OFFERs can be in state TT_RETURNED, this status will be
returned if the specified message is a TT_NOTICE or a TT_REQUEST.
TT_ERR_POINTER
The pointer passed does not point to an object of the correct type for this operation.
APPLICATION USAGE
The application can use tt_free to free any data stored in the address returned by the ToolTalk API.
SEE ALSO
Tt/tt_c.h - Tttt_c(5), tt_message_abstainers_count(3), tt_ptr_error(3), tt_free(3).
tt_message_abstainer(library call)