Sponsored Content
Top Forums Shell Programming and Scripting Read file from nth line to specific character Post 302611087 by aigles on Thursday 22nd of March 2012 08:13:07 AM
Old 03-22-2012
You can do something like that :
Code:
awk 'NR>=From {print; if (/@/) exit }' From=3 inputfile

Jean-Pierre.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Read First Character of Each Line in File

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

Print lines with specific character at nth position in a file

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

Print lines with specific character at nth position in a file

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

How to read one character form each line of the file?

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

Read a file from the nth line on

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

Search and recursively enter new line after Nth character

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

Removing last character of a specific line from a file

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

Insert character at specific location in a each line of the file

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

How to read the nth character from the line.?

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

Count specific character of a file in each line and delete this character in a specific position

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
tt_message_accepter(library call)										 tt_message_accepter(library call)

NAME
tt_message_accepter -- return offer's nth accepting procid SYNOPSIS
#include <Tt/tt_c.h> char *tt_message_accepter( Tt_message m, int n); DESCRIPTION
The tt_message_accepter function returns the procid of the nth accepter 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 accepter to be returned. The first accepter is numbered zero. RETURN VALUE
Upon successful completion, the tt_message_accepter function returns the procid of the nth accepter. 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_accepters_count(3), tt_ptr_error(3), tt_free(3). tt_message_accepter(library call)
All times are GMT -4. The time now is 02:58 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy