10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi,
I have a input file with the following entries:
1one
2two
3three
1four
2five
3six
1seven
1eight
1nine
2ten
2eleven
2twelve
1thirteen
2fourteen
The output should be: (5 Replies)
Discussion started by: supchand
5 Replies
2. Shell Programming and Scripting
Hi,
I have a input file with the following entries:
1one
2two
3three
1four
2five
3six
1seven
1eight
1nine
2ten
The output should be
1one
2two
3three
1four
2five
3six (2 Replies)
Discussion started by: supchand
2 Replies
3. Shell Programming and Scripting
Good Morning/Afternoon All,
I am using the nawk utility in korn shell to find the longest field and display that result.
My Data is as follows:
The cat ran
The elephant ran
Milly ran too
We all ran
I have tried nawk '{ if (length($1) > len) len=length($1); print $1}' filename
The... (5 Replies)
Discussion started by: SEinT
5 Replies
4. Shell Programming and Scripting
Friends ,
I have a large file and i need to insert a line after every line.I am actually unaware how to do it.Any help appreciated.
My File
control station *ATM* , qread $OSS.Jul13A.FI01 interval 1 intcount 1
control station *ATM* , qread $OSS.Jul13A.FI02 interval 1 intcount... (4 Replies)
Discussion started by: appu2176
4 Replies
5. Shell Programming and Scripting
I have a growing file . I knew only last few lines which is constant for evey job run. I'd need to pull the Nth record from the last line. In this case i should not use search pattern. (2 Replies)
Discussion started by: ford2020
2 Replies
6. Shell Programming and Scripting
Hi all,
I have to append every alternate line after its previous line. For example if my file has following contents
line 1: unix is an OS
line 2: it is open source
line 3: it supports shell programming
line 4: we can write shell scripts
Required output should be
line1: unix is an OS it is... (4 Replies)
Discussion started by: rish_max
4 Replies
7. Shell Programming and Scripting
Hello:
I am trying to perform a certain action if the current record is the last line of the input file. But I am unable to figure out how to determine the last line of a file in awk.
I need to do something like this:
awk '{ if (lastline == NR) Do Something}' myfile.txt
I have tried the... (3 Replies)
Discussion started by: PacificWonder
3 Replies
8. Shell Programming and Scripting
Hi Guys,
This is Narasa i am new to this forum.I am very proud to join this forum.
I have a question on Line termination for fixed length file.
We got a file from mainframe having fixed length of 587 but when i extract the zip file with notepad it looks like continuous line with out any... (3 Replies)
Discussion started by: narasa
3 Replies
9. Shell Programming and Scripting
Hi all!!
After experiencing great helpfulness the last time I posted a problem at this site, I once again turn to the forum for expert help.
The problem:
I have a file.dat containing x, y, and z coordinates, like:
x y z
1 1 4
1 2 3
1 3 9
2 1 7
2 2 2
2 3 8
3 1 ... (7 Replies)
Discussion started by: bjorb
7 Replies
10. UNIX for Dummies Questions & Answers
Can someone help , how to add a terminator at the end of each line through shell command.
ex:
input file:
abc
xyz2
outputfile (terminator is !)
abc!
xyz2! (1 Reply)
Discussion started by: thanuman
1 Replies