9 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hello, I currently have managed to get an awk function working inside a for loop that allows me to combine two files based on their headings but what I have not been able to do is print the output to files with variable names.
awk '
NR==FNR {a=$0; next}
/^>/ {$0 = $0" "a;}
... (2 Replies)
Discussion started by: Allie_gastrator
2 Replies
2. Shell Programming and Scripting
Hi All,
I am new to AWK programming. I have the following for loop in my awk program.
cat printhtml.awk:
BEGIN
-------- <some code here>
END{
----------<some code here>
for(N=0; N<H; N++)
{
for(M=5; M<D; M++) print "\t" D "";
}
-----
}
... (2 Replies)
Discussion started by: ctrld
2 Replies
3. Shell Programming and Scripting
Hi All,
i have three files
inputfilehello1,my name is unix.com. hello1,I am awesome. Hope you know this,hello2!,wat else hello2!
hello1.txtHi Friends
Hi Folks
Hi Well-Wishers
hello2.txtHoney
Sweety
Darling
Expected outputHi Friends,my name is unix.com. Hi Friends,I am awesome. Hope you... (4 Replies)
Discussion started by: Makarand Dodmis
4 Replies
4. Shell Programming and Scripting
Here's my code:
awk -F '' 'NR==FNR {
if (/time/ && $5>10)
A=$2" "$3":"$4":"($5-01)
else if (/time/ && $5<01)
A=$2" "$3":"$4-01":"(59-$5)
else if (/time/ && $5<=10)
A=$2" "$3":"$4":0"($5-01)
else if (/close/) {
B=0
n1=n2;
... (2 Replies)
Discussion started by: klane
2 Replies
5. Shell Programming and Scripting
Hi, everyone!
I have a file, when I print its $1 out it show several strings like this:
AABBCC
AEFJKLFG
FALEF
FAIWEHF
What I want to do is that, after output of each record, search the string in all files in the same folder, print out the record and file name.
This is what I want... (4 Replies)
Discussion started by: xshang
4 Replies
6. Shell Programming and Scripting
Hi, Gurus,
I have a requirement as following:
source data:
103,8,25
I want to get
103 8 25 1_8
103 8 25 9_16
103 8 25 17_24
103 8 25 25_32
103 8 25 33_40
103 8 25 41_48
103 8 25 49_56
103 8 25 57_64
103 8 25 65_72
103 8 25 73_80
103 8 25 81_88
103 8 25 89_96
103 8 25 97_104
103 8... (5 Replies)
Discussion started by: ken002
5 Replies
7. Shell Programming and Scripting
I have two files which I would like to compare and then manipulate in a way.
File1:
pictures.txt 1.1 1.3
dance.txt 1.2 1.4
treehouse.txt 1.3 1.5
File2:
pictures.txt 1.5 ref2313 1.4 ref2345 1.3 ref5432 1.2 ref4244
dance.txt 1.6 ref2342 1.5 ref2352 1.4 ref0695 1.3 ref5738 1.2... (1 Reply)
Discussion started by: linuxkid
1 Replies
8. Shell Programming and Scripting
Hello,
I am trying to use AWK to print only the first field of numerous text files, and then overwrite these files. They are of the format 1*2,3,4,5. I have tried the following code (using tcsh):
foreach f (file1 file2 file3)
cat $f | awk -F'*' '{print $1}' > $f
end
However, I get very... (4 Replies)
Discussion started by: Jahn
4 Replies
9. Programming
here is the server and client side code now there is a bug after which the server enters an infinite loop.the server is designed as an echo server and if it reads /q then the server closes while the client can send messages till /q now after the frst msg when another msg is send infinite loop is... (3 Replies)
Discussion started by: arjunjag
3 Replies