Sponsored Content
Full Discussion: Complex awk problem
Top Forums Shell Programming and Scripting Complex awk problem Post 302770501 by RudiC on Saturday 16th of February 2013 02:59:41 PM
Old 02-16-2013
Not sure I understand your new problems. Why don't you add a "0" to both occurrences of "1000" making them "10000" in above script and give it a shot?
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Complex Pipeline/Redirection/Regular Expression problem

This is a very hard unix command which I could not perform..... :( ......here it is: The file ~unx122/public/data.txt contains over 18,000 lines of text. Here are the first ten lines of the file: pagination 20657 2740 28416 31090 18145 shiner 1695 2507 9964 14512 13122 cool 29210... (1 Reply)
Discussion started by: netmaster
1 Replies

2. Shell Programming and Scripting

Complex problem about nested for loops

Hey, I'm writing this bash script that will test print me many copies of the same program but with different combos of 4 variables being between 1 and 100. Here's the code: #! /bin/bash x=0 for ((a=1; a < 101; a++)) do for ((b=1; b < 101; b++)) do for ((c=1; c < 101; c++)) do for... (4 Replies)
Discussion started by: Silverlining
4 Replies

3. Shell Programming and Scripting

Complex file count problem

Hi all! I have a question regarding possibilities to do line counts. SEARCH_VAR=TEX rsh $REM_HOST -l $REM_USER "cd $REM_DIR; ls *$SEARCH_VAR* 2> /dev/null" | sort -n | awk 'BEGIN { FS = "-" } ; { print $1"\t"$0 }' Will produce an output on the screen like this: 483 483-SOME-TEXT-1... (1 Reply)
Discussion started by: bbergstrom74
1 Replies

4. IP Networking

Need to solve complex network problem

I have a Red Hat linux server X on a x.x.0.0 network. This machine also has to communicate with another server Y on a network called y.y.0.0 Server X has two network interfaces. eth0 is configured on the x.x.0.0 network and has a default gateway on the x.x.0.0 network. In order to... (4 Replies)
Discussion started by: soliberus
4 Replies

5. Shell Programming and Scripting

Complex use with awk

Hi , I have file named docs.txt The content of the file look like this: DOC disk location Size ======= ===== ============= ========= TXT A /dev/dm-1 10 TXT B /dev/dm-2 10 BIN C ... (3 Replies)
Discussion started by: yoavbe
3 Replies

6. Shell Programming and Scripting

complex Awk Question

Hi, I have a file look likes this : --->start hir Trace file: pudwh_ora_9998.trc Sort options: fchela exeela ***************************************************************count = number of times OCI procedure was executed cpu = cpu time in seconds executing elapsed = elapsed... (3 Replies)
Discussion started by: yoavbe
3 Replies

7. Shell Programming and Scripting

Get values from 2 files - Complex "for loop and if" awk problem

Hi everyone, I've been thinking and trying/changing all day long the below code, maybe some awk expert could help me to fix the for loop I've thought, I think I'm very close to the correct output. file1 is: <boxes content="Grapes and Apples"> <box No.="Box MT. 53"> <quantity... (8 Replies)
Discussion started by: Ophiuchus
8 Replies

8. Shell Programming and Scripting

awk script (complex)

picked this up from another thread. echo 1st_file.csv; nawk -F, 'NR==FNR{a++;next} a{b++} END{for(i in b){if(b-1&&a!=b){print i";\t\t"b}else{print "NEW:"i";\t\t"b} } }' OFS=, 1st_file.csv *.csv | sort -r i need to use the above but with a slight modification.. 1.compare against 3 month... (25 Replies)
Discussion started by: slashbash
25 Replies

9. Shell Programming and Scripting

Help with Complex Awk.

Hi, I have a file. In this file when ever the word "ABC" occurs at position from 25 and 34 I would like to replace the value at postion 100 to 5 for the first 1000 rows only. I have written the following Awk command. nawk 'substr($0,25,9)=="ABC" {print $0}' filename The above command... (4 Replies)
Discussion started by: pinnacle
4 Replies

10. Shell Programming and Scripting

Complex text parsing with speed/performance problem (awk solution?)

I have 1.6 GB (and growing) of files with needed data between the 11th and 34th line (inclusive) of the second column of comma delimited files. There is also a lot of stray white space in the file that needs to be trimmed. They have DOS-like end of lines. I need to transpose the 11th through... (13 Replies)
Discussion started by: Michael Stora
13 Replies
mark(1mh)																 mark(1mh)

Name
       mark - mark messages

Syntax
       mark [ +folder ] [ msgs ] [ options ]

Description
       Use the command to assign a name to a sequence of messages within the current folder.

       A  sequence  is	a  number of messages that are grouped together under a name.  You can then use that name with any MH command instead of a
       message number, to perform the command on all the messages in the sequence.  You can still continue to handle  messages	individually  when
       they belong to a sequence, just as you did before.  Sequences are specific to a particular folder.  You can use the same name for sequences
       in different folders without causing problems.

       By default, operates on the sequences in the current folder.  You can specify another folder by using the +folder argument.

       When you create a sequence using the ordering of messages within the folder remains unchanged.  So if messages 3, 7 and 9 are put into  the
       sequence,  they	are  still numbered as messages 3, 7 and 9 when you use to list the contents of the folder.  The command does not show you
       what sequences messages belong to; you must use to find this information.

       The command is used only to modify sequences, not messages.  If you delete a message from a sequence using it remains in the folder.   How-
       ever, when a message is deleted or moved from a folder (for example, using or it is removed from all the sequences in that folder.

Options
       -add	 Adds  messages  to sequences.	The command takes the messages specified by the msgs argument, and adds them to the sequence named
		 by using the -sequence name option.  If no msgs argument is given, the current message is added to the sequence.  This option can
		 also be used in conjunction with the -zero option.

		 This  option cannot be used in conjunction with the -delete or -list options.	If you attempt to use two or more of these options
		 together, takes the last occurrence of any of them, and ignores any previous occurrences.

       -delete	 Deletes messages from sequences.  The command removes the messages specified by the msgs argument from the named  sequences.	As
		 with  -add,  the  sequences  are specified using the -sequence name option.  If no msgs argument is given, the current message is
		 removed from the named sequences.  This option can also be used in conjunction with the -zero option.

		 This option cannot be used in conjunction with the -add or -list options.  If you attempt to use two or  more	of  these  options
		 together, takes the last occurrence of any of them, and ignores any previous occurrences.

       -help	 Prints a list of the valid options to this command.

       -list	 Lists	the  sequences	defined for the current folder and the messages associated with those sequences.  If you wish to list only
		 particular sequences in a folder, you can specify them by using the -sequence name option.  If you do not use this option,  lists
		 all the sequences in the current folder.  You can also list sequences in another folder by using the +folder argument.

		 This  option  cannot be used in conjunction with the -add or -delete options.	If you attempt to use two or more of these options
		 together, takes the last occurrence of any of them, and ignores any previous occurrences.

		 The command automatically lists the sequences in the folder unless you use the -add or -delete options, or unless you give a msgs
		 argument.

       -public
       -nopublic Indicates  that  the sequence being created should be made readable for other MH users.  When you use the -add option to create a
		 sequence, the -public option makes the sequence public, that is, readable to other MH users.  By contrast, the  -nopublic  option
		 indicates that the sequence should be private, or exclusive to your own MH environment.

       -sequence name...
		 Specifies  the  sequence(s)  you  wish  to  list or modify.  You use this option in conjunction with the -add, -delete, and -list
		 options, to name the sequences you wish to add messages to, delete messages from, or list.  You can name more than  one  sequence
		 by listing the names with a space separating them; you do not need to repeat -sequence before each sequence name.

       -zero
       -nozero	 Modifies the behavior of the -add and -delete options.

		 If  you use the -zero option with -add, all messages are removed from the named sequence before the new messages are added to it.
		 This means that the sequence contains only the new messages that you have just added.	The -nozero option  simply  adds  the  new
		 messages to the existing sequence, without deleting any of the messages already in the sequence.  This is the default behavior.

		 If you use -zero with -delete, all of the messages in the folder are added to the named sequence, and then the messages you spec-
		 ify are deleted from the sequence.  This means that the sequence contains all the messages in the folder except  those  that  you
		 have  named.	The  -nozero option simply removes the messages you specify from the sequence, leaving the rest of the contents of
		 the sequence intact.  This is the default behavior.

       The defaults for this command are:

	      +folder defaults to the current folder
	      msgs defaults to the current message (or all messages if -list is specified)
	      -add if a msgs argument is specified, -list otherwise
	      -nopublic if the folder is read-only, -public otherwise
	      -nozero

Restrictions
       MH allows a maximum of ten sequences in any folder.

       The names of sequences must consist entirely of alphabetic or numeric characters, and must begin with an alphabetic character.  Punctuation
       is not allowed.	In addition, certain names are reserved for use by MH.	These include first, next, prev, and cur.

Examples
       The first example shows how lists all the sequences in a named folder:
       % mark
       cur: 20
       Admail: 1 5 9-12
       test: 3-7
       This output is identical to that produced by using the -list option.

       The next example creates a sequence called odd, containing the first five odd-numbered messages:
       % mark -add -sequence odd 1 3 5 7 9
       % mark
       cur: 20
       Admail: 1 5 9-12
       odd: 1 3 5 7 9
       test: 3-7

       The next example deletes message 3 from the sequences test and odd:
       % mark -delete -sequence test odd 3
       % mark
       cur: 20
       Admail: 1 5 9-12
       odd: 1 5 7 9
       test: 4-7

       The  final  example illustrates how the -zero option works with -add.  All messages are first removed from the sequence test, and then mes-
       sages 1 to 3 are added.	The result is that test contains only messages 1 to 3:
       % mark -add -zero -sequence test 1-3
       % mark
       cur: 20
       Admail: 1 5 9-12
       odd: 1 5 7 9
       test: 1-3

Profile Components
       Path:   To determine your Mail directory

Files
       The user profile.

See Also
       folder(1mh), pick(1mh), sortm(1mh)

																	 mark(1mh)
All times are GMT -4. The time now is 08:11 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy