12-23-2008
print remaining part from the first-match within a file
Hi, i was looking for unix command(s) for :
find the first occurrence of a given pattern with in a file and print the remaining part.
below is an example of what i am looking for:
lets say, a file named myfile.txt
Quote:
# more myfile.txt
A
B
C
D
E
#
now, the command i am looking for will do the following
Quote:
# my_command C myfile.txt
C
D
E
#
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi ,
could any one suggest me that how to determine if the first field is numeric and if it is greater than another number then from that point everything else should be printed using awk.
I have tried this
:
awk -v xxxx=$xxxxx '
BEGIN {
enable=0
}
{
print $1
if ( ( $1 !~ "^*$" ... (5 Replies)
Discussion started by: hitmansilentass
5 Replies
2. Shell Programming and Scripting
Hi all,
I have 2 files. One contains only 1 column and other one contains 2 columns, let say 1_col.txt and 2_col.txt respectively. Here, I will try to explain with an example.
Input files :
1_col.txt 2_col.txt
a a b
x a c
p ... (5 Replies)
Discussion started by: AshwaniSharma09
5 Replies
3. Shell Programming and Scripting
Hello all, please help. There are two file like this:
file1:
1197510.0 294777.7 9666973.0 21.6 1839.8
1197510.0 294777.7 9666973.0 413.2 2075.9
1197510.0 294777.7 9666973.0 689.3 2260.0
... (1 Reply)
Discussion started by: attila
1 Replies
4. Shell Programming and Scripting
Hi All,
I have to match each row in file 1 with 1st row in file 2 and print the corresponding column from file2. I am trying to use an awk script to do this. For example
cat File1
X1
X3
X4
cat File2
ID X1 X2 X3 X4
A 1 6 2 1
B 2 7 3 3
C 3 8 4 1
D 4 9 1 1 (3 Replies)
Discussion started by: newpro
3 Replies
5. UNIX for Advanced & Expert Users
Hi
I am checking status of sftp in Health check script, sftp command is used to connect the server with secure RSA key, which is successfully get connected most of the time but in some case if RSA key ask for password then I need to exit sftp command after few second and continue to run... (1 Reply)
Discussion started by: ketanraut
1 Replies
6. Shell Programming and Scripting
Hi, all
I need your help and suggestions.
I want to print particular strings in a field of a csv file and show them in terminal. Here is an example of the csv file.
SourceFile,Airspeed,GPSLatitude,GPSLongitude,Temperature,Pressure,Altitude,Roll,Pitch,Yaw... (7 Replies)
Discussion started by: refrain
7 Replies
7. Shell Programming and Scripting
Want to get the remaining line after pattern match Here it starts - executed commands : - pattern to identify 100:27:500:1:34:END
Required output:100:27:500:1:34:END
awk '{if(/pattern to identify/) print $2}' < file
I have used above code and it not giving... (3 Replies)
Discussion started by: rozee
3 Replies
8. Shell Programming and Scripting
Hi All,
I am having a text file like below
ERROR - Not a valid
ID : 123
ERROR - Not a valid
hello
ID : 124
SUCCESS - Valid
ID : 12
I need to display like below after reading the file if it finds the error keyword
along with displaying this first line when error pattern... (10 Replies)
Discussion started by: rohit_shinez
10 Replies
9. Shell Programming and Scripting
Hello there
I'd like to make a copy of 2nd column and have it printed in place of column 1. Remaining columns are needed as it.
test data:
ProbeSet GeneSymbol X22565285 X22566285
ILMN_1050008 MYOCD 6.577 7.395
ILMN_1050014 GPRC6A 6.595 6.668
ILMN_1050017 ... (2 Replies)
Discussion started by: genome
2 Replies
10. Shell Programming and Scripting
Hello Folks,
I have an requirement, where i need to get total count of the file based on creation date with there filename selected pattern.
Filename: MobileProtocol.20171228T154200.157115.udr
I want to get the count of files created on each day based on a pattern find.
find . -type... (7 Replies)
Discussion started by: sadique.manzar
7 Replies
TPAGE(1) User Contributed Perl Documentation TPAGE(1)
NAME
Template::Tools::tpage - Process templates from command line
USAGE
tpage [ --define var=value ] file(s)
DESCRIPTION
The tpage script is a simple wrapper around the Template Toolkit processor. Files specified by name on the command line are processed in
turn by the template processor and the resulting output is sent to STDOUT and can be redirected accordingly. e.g.
tpage myfile > myfile.out
tpage header myfile footer > myfile.html
If no file names are specified on the command line then tpage will read STDIN for input.
The "--define" option can be used to set the values of template variables. e.g.
tpage --define author="Andy Wardley" skeleton.pm > MyModule.pm
See Template for general information about the Perl Template Toolkit and the template language and features.
AUTHOR
Andy Wardley <abw@wardley.org>
<http://wardley.org/>
VERSION
2.68, distributed as part of the Template Toolkit version 2.19, released on 27 April 2007.
COPYRIGHT
Copyright (C) 1996-2007 Andy Wardley. All Rights Reserved.
This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
SEE ALSO
ttree
perl v5.12.1 2008-11-13 TPAGE(1)