Sponsored Content
Full Discussion: Help with uniq -D [prepend]
Top Forums Shell Programming and Scripting Help with uniq -D [prepend] Post 302353792 by eknryan on Wednesday 16th of September 2009 08:39:16 AM
Old 09-16-2009
Thanks Thanhdat!,
The uniq command worked a treat however the AWK prints a 5 line gap between replicate sets. Ive played about with it but cannot reduce this. I am using gawk, would this make a difference?

Is there any way of adding say a string with a count in each blank line i.e line1, line2,line3 etc?

Thanks again
Ryan
 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Prepend name of directory to children folders

Hi, I am a shell scripting newbie. I am in need of a shell script that will prepend the name of the parent directory to the child directory. For example if the shell script called rename.sh is invoked with ">rename.sh /home/foobar/Simple" and the structure of the folder Simple is : Simple... (7 Replies)
Discussion started by: kalichar
7 Replies

2. UNIX for Dummies Questions & Answers

prepend columns to a file

I have two files. File 'a' has contents: 1|1 2|2 3|3 4|4 and file 'b' has contents: abc|def hij|klm nop|qrs tuv|wxy I would like to prepend file 'a' to file 'b' (with pipe) such that the contents of 'b' will be: 1|1|abc|def 2|2|hij|klm 3|3|nop|qrs 4|4|tuv|wxy (3 Replies)
Discussion started by: ChicagoBlues
3 Replies

3. Shell Programming and Scripting

prepend and append characters to the same line

Hi, I have a file 'tmp.dat' that contains the below data: 81763 40829 30405 80452 I want to prepend a ' character to the beginning of every line, and I want to append ', at the end of every line. Below is what I expect: '81763', '40829', '30405', '80452', Can anyone help me? ... (3 Replies)
Discussion started by: ChicagoBlues
3 Replies

4. Shell Programming and Scripting

sed prepend text ?

Hi, I have a file with email header information. I would like to change the Subject line. Subject: ** PROBLEM Host Alert: server.domainname is DOWN ** I'd like to change this line such as to look, Subject: serverID ACK Fw: ** PROBLEM Host Alert: server1.domainname is DOWN** How can I... (2 Replies)
Discussion started by: upengan78
2 Replies

5. Shell Programming and Scripting

How to prepend spaces using sed command..?

hi all , i had the below sed command to append header at the starting of my output file .... sed -i -e '1i saikumar suresh hemanth' output.txt i want to append spaces to the Name saikumar how can i append with in this command ....? (1 Reply)
Discussion started by: hemanthsaikumar
1 Replies

6. Shell Programming and Scripting

How to prepend filename to its content without a third file?

Hello, Is possibly there a way to prepend the filename to its content without a third file? The reason is to add a header to each file contents to distinguish each other when they are pasted side-by-side. sample.txt: XLOC_001 0 XLOC_002 23 XLOC_003 4 XLOC_012 6output (with the same... (4 Replies)
Discussion started by: yifangt
4 Replies

7. Shell Programming and Scripting

Prepend text, different matched 1st letters

Prepending lines with: your, the, a or an based on 1st letter match. You'll see my problem below: sed '/^p\|^f\|^c\|^d\|^l/ s/^/your /' list.txt > your.txt && sed '/^v\|^j\|^k\|^m\|^n\|^s/ s/^/the /' your.txt > the.txt && sed '/^b\|^g\|^h\|^q\|^r\|^t\|^w\|^z/ s/^/a /' the.txt > a.txt && sed... (10 Replies)
Discussion started by: p1ne
10 Replies

8. Shell Programming and Scripting

Add number prepend certain lines

from a(depends: ) bb(depends:lmbench ) cc(depends: ) CONFIG_DEFAULT1=y CONFIG_IOSCHED1=y CONFIG_CGROUP1=y ddd(depends: ) CONFIG_GENERIC_CPU1=y CONFIG_CRYPTO_AES_NI1=m to 1. a(depends: ) 2. bb(depends:lmbench ) 3. cc(depends: ) CONFIG_DEFAULT1=y ... (8 Replies)
Discussion started by: yanglei_fage
8 Replies

9. UNIX for Beginners Questions & Answers

Prepend 0 to a field in a record

Hi All, I have a file like below. In the field 9 I am having 14,014,3,001/009 on the records. I want to convert the field to a three digit value. For example 14 should 014 , 3 should 003 11050;11001;;CREDITTRANC;5293218;NRATL;;;11095;;-1;14;3;29=0000;1.25... (5 Replies)
Discussion started by: arunkumar_mca
5 Replies
IGAWK(1)							 Utility Commands							  IGAWK(1)

NAME
igawk - gawk with include files SYNOPSIS
igawk [ all gawk options ] -f program-file [ -- ] file ... igawk [ all gawk options ] [ -- ] program-text file ... DESCRIPTION
Igawk is a simple shell script that adds the ability to have ``include files'' to gawk(1). AWK programs for igawk are the same as for gawk, except that, in addition, you may have lines like @include getopt.awk in your program to include the file getopt.awk from either the current directory or one of the other directories in the search path. OPTIONS
See gawk(1) for a full description of the AWK language and the options that gawk supports. EXAMPLES
cat << EOF > test.awk @include getopt.awk BEGIN { while (getopt(ARGC, ARGV, "am:q") != -1) ... } EOF igawk -f test.awk SEE ALSO
gawk(1) Effective AWK Programming, Edition 1.0, published by the Free Software Foundation, 1995. AUTHOR
Arnold Robbins (arnold@skeeve.com). Free Software Foundation Nov 3 1999 IGAWK(1)
All times are GMT -4. The time now is 11:35 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy