Sponsored Content
Top Forums Shell Programming and Scripting How to conditionally display and remove first line only? Post 302928719 by jasn on Sunday 14th of December 2014 05:59:29 PM
Old 12-14-2014
Don,

One last thing. Based on Derek's suggestion and his find one liners, is it possible to add to your shell script a function to replace all lines that begin with

Code:
>From

with

Code:
From

I'm not sure that is having an effect on this conversion, but I think it would be useful to clean things up from that perspective.

Thanks,

Jason
 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

sed csv remove conditionally

Hello, I have many csv file, but I would like to delete lines with some values in a column conditionally. My example look like this, ex1e, ex2g, ex39, pasg, ssg, mrlc, pc, kb, coop -112, -53, -177, 64, 62, 71, 1, 487, 20 -101, -61, -53, 0, 32767, 51, 0, ... (6 Replies)
Discussion started by: Jae
6 Replies

2. Shell Programming and Scripting

Display mutiple line in single line

Hi All, I had a file called Input.txt, i need to group up in a single line as 1=ttt and the no of lines may vary bewteen the 1=ttt cat Input.txt 1=ttt,2=xxxxxx, 3=4545 44545, 4=66667 7777, 5=77723 1=ttt, 2=xxxxxx, 3=34436 66 3545, 4=66666, 5=ffffff, 6=uuuuuuu 1=ttt, 2=xxxxxx,... (4 Replies)
Discussion started by: manosubsulo
4 Replies

3. Shell Programming and Scripting

Remove newline character conditionally

Hi All, I have 5000 records like this Request_id|Type|Status|Priority|Ticket Submitted Date and Time|Actual Resolved Date and Time|Current Ticket Owner Group|Case final Ticket Owner Group|Customer Severity|Reported Symptom/Request|Component|Hot Topic|Reason for Missed SLA|Current Ticket... (2 Replies)
Discussion started by: j_53933
2 Replies

4. Shell Programming and Scripting

Remove file conditionally between two server using sftp

Hi, I am having 2 servers, Need to delete files from server1 if those files exist in server2 other wise no action using sftp .And the process is non-interactive way. I have got confused how to check the condition in sftp because there is non of the shell condition or loop command is executing.... (2 Replies)
Discussion started by: posix
2 Replies

5. Shell Programming and Scripting

Add text at the end of line conditionally

Hi All, I have a file as below: cat myfile abcdef NA rwer tyujkl na I wish to add the text ".txt" at the end of all lines except the lines starting with NA or na. I know i can add text at the end of line using following command but I am not sure how to valiate the condition. (14 Replies)
Discussion started by: angshuman
14 Replies

6. Shell Programming and Scripting

awk to insert new line conditionally

Dear All, I have a file like: If $4=2001, a duplicated line will be inserted and $4 will be assigned value 2011; so that the new file would be: How to write awk to accomplish this? thank you very much! (5 Replies)
Discussion started by: littlewenwen
5 Replies

7. UNIX for Dummies Questions & Answers

To find and display the middle line in a file using single line command.

Hi all, How can i display the middle line of a file using a single line command? (6 Replies)
Discussion started by: Lakme Pemmaiah
6 Replies

8. Shell Programming and Scripting

Conditionally add character at end of line

Hi, I would like have a shell script to check every line in a file to see if it ends with ";". If this is NOT the last character ";" should be added. MyFile.csv : web9331801;01/01/2014 23:39:35;;"93962";353150256; web9331802;01/01/2014 23:44:29;;"479288";353153538; web9331803;01/01/2014... (14 Replies)
Discussion started by: vg77
14 Replies

9. Shell Programming and Scripting

Ksh: Read line parse characters into variable and remove the line if the date is older than 50 days

I have a test file with the following format, It contains the username_date when the user was locked from the database. $ cat lockedusers.txt TEST1_21062016 TEST2_02122015 TEST3_01032016 TEST4_01042016 I'm writing a ksh script and faced with this difficult scenario for my... (11 Replies)
Discussion started by: humble_learner
11 Replies
XtAppCreateShell()														XtAppCreateShell()

Name
  XtAppCreateShell - create a shell widget at the root of a widget tree.

Synopsis
  Widget XtAppCreateShell(application_name, application_class, widget_class, display, args, num_args)
	 String application_name;
	 String application_class;
	 WidgetClass widget_class;
	 Display *display;
	 ArgList args;
	 Cardinal num_args;

Inputs
  application_name
	    Specifies the resource name of the shell widget, or NULL.

  application_class
	    Specifies the resource class to be used for the shell widget if it is of applicationShellWidgetClass or a subclass thereof.

  widget_class
	    Specifies the widget class of the created widget.  (normally applicationShellWidgetClass).

  display   Specifies the display on which the shell is to be created.

  args	    Specifies the argument list to override other resource specifications.

  num_args  Specifies the number of arguments in the argument list.

Description
  XtAppCreateShell()  creates a shell widget of class widget_class on display display.	The created widget has no parent-it is at the root of
  a widget tree and at the top of the resource name hierarchy.	The resource name of the widget is either application_name, or,  if  that  is
  NULL,  the  name  that  was passed to XtDisplayInitialize() or XtOpenDisplay() when the display was initialized.  The resource class of the
  widget is either application_class, if the widget_class is applicationShellWidgetClass or a subclass, or the normal class name of the  wid-
  get  otherwise.   The  widget  is  created on the screen specified by the XtNscreen resource or on the default screen of display if no such
  resource is found.

  In X11R4, the XtNscreen and other resources are all obtained from args and from the database of display.  In X11R5,  however,  there	is  a
  resource database for each screen of a display, and the resources for the created shell widget are obtained somewhat differently: the argu-
  ment list args is first scanned for a resource named XtNscreen, and if none is found, the database of the  default  screen  of  display  is
  searched			for			 this			   resource.			   If			  the
  XtNscreen resource is found the database from the specified screen is used for all the remaining resources of the widget.  If the XtNscreen
  resource  is	not found, the database of the default screen continues to be used.  In either case, the resources in args override values in
  the database.

Usage
  Most applications can simply use XtAppInitialize() which initializes the toolkit, creates an application context, opens a display, and then
  calls XtAppCreateShell() to create a shell on that display.

  An  application  that  wishes  to have multiple toplevel windows on the same screen (a mail reader and a mail composer, for example) should
  generally use XtCreatePopupShell() to create additional shells within the widget tree and resource hierarchy of the original shell.  Creat-
  ing  multiple  root  shells  with  different names is generally not a good idea because then your application will have resources specified
  under several different hierarchies.	It is sometimes useful to create multiple root shells with the same name, however, if  your  applica-
  tion	is  capable  of creating multiple instances of itself.	Each of these instances will find the same resources in the same database and
  will appear to be "clones" of each other.

  To create shells on multiple displays, open each display with XtOpenDisplay() and use the resulting  Display	*  in  a  call	to  XtAppCre-
  ateShell().  If all displays are initialized in the same application context, then all events will be correctly handled by XtAppMainLoop().

  XtAppCreateShell()  can  also be used to create toplevel shells on multiple screens.	Note that prior to X11R5, however, it is not possible
  to maintain separate resource databases for each screen.

  The specified widget class for the new shell widget should almost always be applicationShellWidgetClass or some subclass.

  XtVaAppCreateShell() behaves identically to XtAppCreateShell(), but takes a  NULL-terminated	variable-length  argument  list  of  resource
  name/resource value pairs rather than an array of Arg.

See Also
  XtAppInitialize(1), XtCreatePopupShell(1), XtDisplayInitialize(1), XtOpenDisplay(1),
  XtVaAppCreateShell(1).

Xt - Initialization														XtAppCreateShell()
All times are GMT -4. The time now is 07:34 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy