Sponsored Content
Top Forums Shell Programming and Scripting Parsing a file based on positional constraints Post 302928410 by RudiC on Thursday 11th of December 2014 12:18:30 PM
Old 12-11-2014
Try
Code:
awk     'NR==FNR        {T[$1]; next}
                        {for (i in T)
                                {if (T[i]!="Int")
                                   {if ($1==i || $NF==i) T[i]="Ext"
                                    for (j=2; j<NF; j++) if ($j==i) T[i]="Int"
                                   }
                                }
                        }
         END            {for (i in T) print i > T[i]}  
        ' file1 file2
  Int :
dog
crow
cat
fox
  Ext :
fish
duck
cow

 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Parsing of file for Report Generation (String parsing and splitting)

Hey guys, I have this file generated by me... i want to create some HTML output from it. The problem is that i am really confused about how do I go about reading the file. The file is in the following format: TID1 Name1 ATime=xx AResult=yyy AExpected=yyy BTime=xx BResult=yyy... (8 Replies)
Discussion started by: umar.shaikh
8 Replies

2. Shell Programming and Scripting

Get the positional value from first line of the file

Hi, I have one flat file with delimited field as pipe(|) symbol. The file contains header,detail lines. Header is the first line in the file. I want to read the value for the position from 15 to 18 in first line of the file. Pls help me to get the value from position 15 to 18 in... (3 Replies)
Discussion started by: praka
3 Replies

3. Shell Programming and Scripting

Split positional flat file.

Hi, I need to split positional flat file, based on value at position 43-45.( in red "410") Example: 12345678907886421689 200920184820410200920020092002007 12345678907886421689 200920184820411200920020092002007 12345678907886421689 200920184820411200920020092002007... (6 Replies)
Discussion started by: meetmedude
6 Replies

4. Shell Programming and Scripting

Parsing Log File Based on Date & Error

I'm still up trying to figure this out and it is driving me nuts. I have a log file which has a basic format of this... 2010-10-10 22:25:42 Init block 'UA Deployment Date': Dynamic refresh of repository scope variables has failed. The ODBC function has returned an error. The database... (4 Replies)
Discussion started by: k1ko
4 Replies

5. Shell Programming and Scripting

parsing file based on characters/bytes

I have a datafile that is formatted as fixed. I know that each line should contain 880 characters. I want to separate the file into 2 files, one that has lines with 880 characters and the other file with everything else. Is this possible ? (9 Replies)
Discussion started by: cheeko111
9 Replies

6. UNIX for Dummies Questions & Answers

Remove lines in a positional file based on string value

Gurus, I am relatively new to Unix scripting and am struck with a problem in my script. I have positional input file which has a FLAG indicator in at position 11 in every record of the file. If the Flag has value =Y, then the record from the input needs to be written to a new file.However if... (3 Replies)
Discussion started by: gsam
3 Replies

7. Shell Programming and Scripting

Positional Update of XML File

Hello, I have a XML file and need to update the data for a specific XML Attribute in the file. I need a Perl or Awk command to look for <INTERCHANGE_CONTROL_NO>000000601</INTERCHANGE_CONTROL_NO> in the XML file and change the first two 0 of the value to 9. For instance ... (4 Replies)
Discussion started by: Praveenkulkarni
4 Replies

8. Shell Programming and Scripting

Parsing a file based on next line

I have a file1 like ID E2AK1_HUMAN Reviewed; 630 AA. CC -!- SUBCELLULAR LOCATION: Host nucleus {ECO:0000305}. ID E1A_ADEM1 Reviewed; 200 AA. ID E1A_ADES7 Reviewed; 266 AA. CC -!- SUBCELLULAR LOCATION: Host nucleus... (8 Replies)
Discussion started by: sammy777
8 Replies

9. Shell Programming and Scripting

File Parsing based on a character in a specific field

Hi All, I'm having a hard time finding a starting point for my issue. I have a 30k line file (fspsec.txt) that I would like to parse into smaller files based on any character existing in field 1. ACCOUNTANT LEVEL 1 (ACCT.ACCOUNTANT) OPERATORS: DOEJO (418) TOOLS: Branch Maintenance ... (2 Replies)
Discussion started by: aahlrich
2 Replies
WMShell(3)							  LessTif Manuals							WMShell(3)

NAME
WMShell - window-manager shell widget from the X toolkit SYNOPSIS
#include <X11/Shell.h> DESCRIPTION
WMShell is a widget which is defined in the X Toolkit. We document its existence here for completeness. Please refer to the X Window Sys- tem documentation for the real information regarding this widget. X RESOURCES
Name Class Type Default Access ------------------------------------------------------------------------ XtNtitle XtCTitle String (null) CSG XtNtitleEncoding XtCTitleEncoding Atom NULL CSG XtNwmTimeout XtCWmTimeout Int 5000 CSG XtNwaitforwm XtCWaitforwm Boolean NULL CSG XtNtransient XtCTransient Boolean NULL CSG XtNbaseWidth XtCBaseWidth Int 135884268 CSG XtNbaseHeight XtCBaseHeight Int 135884268 CSG XtNwinGravity XtCWinGravity Gravity NULL CSG XtNminWidth XtCMinWidth Int 135884268 CSG XtNminHeight XtCMinHeight Int 135884268 CSG XtNmaxWidth XtCMaxWidth Int 135884268 CSG XtNmaxHeight XtCMaxHeight Int 135884268 CSG XtNwidthInc XtCWidthInc Int 135884268 CSG XtNheightInc XtCHeightInc Int 135884268 CSG XtNminAspectX XtCMinAspectX Int 135884268 CSG XtNminAspectY XtCMinAspectY Int 135884268 CSG XtNmaxAspectX XtCMaxAspectX Int 135884268 CSG XtNmaxAspectY XtCMaxAspectY Int 135884268 CSG XtNinput XtCInput Bool NULL CSG XtNinitialState XtCInitialState InitialState NULL CSG XtNiconPixmap XtCIconPixmap Bitmap NULL CSG XtNiconWindow XtCIconWindow Window NULL CSG XtNiconX XtCIconX Int 135884268 CSG XtNiconY XtCIconY Int 135884268 CSG XtNiconMask XtCIconMask Bitmap NULL CSG XtNwindowGroup XtCWindowGroup Window NULL CSG XtNclientLeader XtCClientLeader Widget NULL CSG XtNwindowRole XtCWindowRole String (null) CSG XtNurgency XtCUrgency Boolean NULL CSG XtNtitle XtNtitleEncoding XtNwmTimeout XtNwaitforwm XtNtransient XtNbaseWidth XtNbaseHeight XtNwinGravity XtNminWidth XtNminHeight XtNmaxWidth XtNmaxHeight XtNwidthInc XtNheightInc XtNminAspectX XtNminAspectY XtNmaxAspectX XtNmaxAspectY XtNinput XtNinitialState XtNiconPixmap XtNiconWindow XtNiconX XtNiconY XtNiconMask XtNwindowGroup XtNclientLeader XtNwindowRole XtNurgency CLASS HIERARCHY
Object(3) Rect(3) UnNamedObj(3) Core(3) Composite(3) Shell(3) WMShell(3) CALLBACKS
CONVENIENCE FUNCTIONS
SEE ALSO
LessTif Project October 1998 WMShell(3)
All times are GMT -4. The time now is 05:01 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy