03-22-2012
Read file from nth line to specific character
Hi,
I want to read the file from nth line (where n is an integer) to until I encounter @ char.
Can any one please help me how to do this?
Thanks.
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I need a better way to read the first character of each line in a file and check if it equals the special character ¤. This character tells me where there is a break in the reports. The file has over 500,000 lines. Currently, this is my code -
if ]
I am using Korn Shell as a scripting... (7 Replies)
Discussion started by: azelinsk
7 Replies
2. Shell Programming and Scripting
I need to print lines with character S at nth position in a file...can someone pl help me with appropriate awk command for this (2 Replies)
Discussion started by: manaswinig
2 Replies
3. Shell Programming and Scripting
I need to print lines with character S at nth position in a file...can someone pl help me with appropriate awk command for this (1 Reply)
Discussion started by: manaswinig
1 Replies
4. Shell Programming and Scripting
Hi,
Maybe this iscorrect forum for my question...
I should read one character at a fixed position from each line of the file. So how ??? should be substituted in the code below:
while read line ; do
single_char=`???`
echo "$single_char"
done < $input_file
OK...I did get an... (0 Replies)
Discussion started by: arsii
0 Replies
5. Shell Programming and Scripting
I have a script which reads from a job file and executed the scripts in the job file in sequence.
#! /bin/ksh
set -x
while read line
do
$line.ksh
if
# mail the team
fi
done <"$file"
The job file will be like
abcd
efgh
ijkl
mnop
qrst
This is working fine. I need to add... (2 Replies)
Discussion started by: nw2unx123
2 Replies
6. Shell Programming and Scripting
Hi All,
My file is a string of around 50K character.
I'm trying to insert new line after every 320 character in my file.
I know the command to insert newline, but problem is I'm not able to search 320th position.
Please advice. (6 Replies)
Discussion started by: Amit786
6 Replies
7. Shell Programming and Scripting
Hello guys,
I would need to remove the last character ")" of a specific line. This can be from any line. Your help is appreciated. Below is the line.
HOSTNAME=(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP))
Please help. (6 Replies)
Discussion started by: sang8g
6 Replies
8. Shell Programming and Scripting
Hi All,
I am trying to write a shell script where it should insert character 'I' in 180th position of each line(except first and last line) of the file. Below is the script
for file in /home/test/bharat/*.RET
do
# Process file
echo "File Name=" $file
#l_fileName="${file##*/}"
... (19 Replies)
Discussion started by: bharath561989
19 Replies
9. Post Here to Contact Site Administrators and Moderators
I have Index Line and I tried to get the 9th character from the file and to check the character is "|" or not.
Shell Scripting.
Sample Index file.
"91799489|K8E|188.004.A.917994892.1099R.c.01.pdf|2013|10/15/2014|002|B|C|C"... (3 Replies)
Discussion started by: pavand
3 Replies
10. Shell Programming and Scripting
I will appreciate if you help me here in this script in Solaris Enviroment.
Scenario:
i have 2 files :
1) /tmp/TRANSACTIONS_DAILY_20180730.txt:
201807300000000004
201807300000000005
201807300000000006
201807300000000007
201807300000000008
2)... (10 Replies)
Discussion started by: teokon90
10 Replies
LEARN ABOUT HPUX
tt_message_arg_bval_set
tt_message_arg_bval_set(library call) tt_message_arg_bval_set(library call)
NAME
tt_message_arg_bval_set -- set the byte-array value and type of a message argument
SYNOPSIS
#include <Tt/tt_c.h>
Tt_status tt_message_arg_bval_set(
Tt_message m,
int n,
const unsigned char *value,
int len);
DESCRIPTION
The tt_message_arg_bval_set function sets the byte-array value and the type of the nth message argument.
This function also changes the value of an existing nth message argument to a byte string.
The m argument is the opaque handle for the message involved in this operation. The n argument is the number of the argument to set. The
first argument is numbered zero. The value argument is the byte string with the contents for the message argument. The len argument is
the length of the value in bytes.
RETURN VALUE
Upon successful completion, the tt_message_arg_bval_set function returns the status of the operation as one of the following Tt_status val-
ues:
TT_OK The operation completed successfully.
TT_ERR_NOMP
The ttsession(1) process is not running and the ToolTalk service cannot restart it.
TT_ERR_NUM
The integer value passed was invalid (out of range).
TT_ERR_POINTER
The pointer passed does not point to an object of the correct type for this operation.
APPLICATION USAGE
The sending process can use tt_message_arg_bval_set(3) to fill in opaque data.
SEE ALSO
Tt/tt_c.h - Tttt_c(5), tt_message_barg_add(3), tt_message_arg_val_set(3), tt_message_arg_ival_set(3).
tt_message_arg_bval_set(library call)