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
LEARN ABOUT OSF1
dxmprintwgtaugmentlist
DXmPrintWgtAugmentList(3X) DXmPrintWgtAugmentList(3X)
NAME
DXmPrintWgtAugmentList - Defines additional print formats and lets you add new options to the print widget option menus.
SYNOPSIS
unsigned long int DXmPrintWgtAugmentList(
Widget pw,
int list,
XtPointer data );
PARAMETERS
The print widget. The print formats or options, indicated by the following values:
-------------------------------------------------------
Value Description
-------------------------------------------------------
DXmFILE_BURST_SHEET Specifies the availability and
frequency of printed File Burst
Sheets.
DXmFILE_END_SHEET Specifies the availability and
frequency of printed File End
Sheets.
DXmFILE_START_SHEET Specifies the availability and
frequency of printed File Start
Sheets.
DXmINPUT_TRAY Specifies the input tray holding
the sheet to be used for the
print job.
DXmMESSAGE_LOG Specifies what is to be done
with error messages generated
during the print operation.
DXmOUTPUT_TRAY Specifies the output tray in
which the sheet is to be placed.
DXmPAGE_SIZE Specifies the size of the print
image.
DXmPRINT_FORMAT Specifies the print format.
DXmSHEET_SIZE Specifies the size of the sheet.
DXmSIDES Specifies how many sides of the
sheet will be printed.
-------------------------------------------------------
One of the following data structures: DXmPrintFormatStruct, which has the following structure:
typedef struct _DXmPrintFormatStruct {
XmString ui_string;
XmString os_string;
XmString var_string; } DXmPrintFormatStruct;
Specifies the label displayed in the user interface. Specifies a string that identifies the print format to the operating system.
Specifies the UNIX environment variable that identifies the print format. DXmPrintOptionMenuStruct, which has the following struc-
ture:
typedef struct _DXmPrintOptionMenuStruct {
XmString ui_string;
XmString os_string; } DXmPrintOptionMenuStruct;
Specifies the label displayed in the user interface. Specifies a string that identifies the print option for the operating system.
DESCRIPTION
The DXmPrintWgtAugmentList routine defines additional print formats and lets you add new options to the print widget option menus. Note
that the return value (an integer) is not required when adding print formats. However, the Intrinsics routines XtGetValues and XtSetValues
use that integer when subsequent calls are made on the option menus.
RETURN VALUES
An integer that represents either the number of print formats known to the print widget or the identifier of a new option added to the
print widget option menu, depending on the operation performed. A Null return indicates that the addition of a print format or option was
unsuccessful.
SEE ALSO
DXmCreatePrintBox(3X), DXmCreatePrintDialog(3X), DXmPrintWgtPrintJob(3X)
X Window System Toolkit
DXmPrintWgtAugmentList(3X)