08-23-2009
awk script doesnt modify the actual file, you have to save it to another file and rename it to your original file.
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi Please help me out with this problem:
I want to have a script that would change the nth field seperator in a line into something else.
like
a,d,4,2,97,8,9
into
a,d,4,2,97/8/9
Thanks (2 Replies)
Discussion started by: onthetopo
2 Replies
2. Shell Programming and Scripting
How to create simple awk program data such as below:
input:
1 23
1 34
1 12
2 10
2 11
2 12
3 11
3 12
3 13
expected output:
1 23
1 34
1 12
EOD
2 10
2 11
2 12
EOD (2 Replies)
Discussion started by: jmaskar
2 Replies
3. Shell Programming and Scripting
I have a line like this:
I want to move HTTP/1.1 200 OK to the next line and put a blank line between the two lines i.e.
How can i get it using awk?
Thanks in advance (2 Replies)
Discussion started by: littleboyblu
2 Replies
4. UNIX for Advanced & Expert Users
from this input
WEBELSOLAR,29122009,1:1
WIPRO,15062010,2:3
ZANDUREALT,18012007,1:3
i want output as
WEBELSOLAR,20091229,1:1
WIPRO,20100615,2:3
ZANDUREALT,20070118,1:3
basically input is in ddmmyyyy format and i was to convert it to yyyymmdd format (1 Reply)
Discussion started by: manishma71
1 Replies
5. Shell Programming and Scripting
Hello,
I have the following example data file:
Rv.Global_Sk,1077.160523,D,16/09/2011
Rv.Global_Sk,1077.08098,D,17/09/2011
Rv.Global_Sk,1077.001445,D,18/09/2011
Rv.Global_Sk,1072.660733,D,19/09/2011
Rv.Global_Sk,1070.381557,D,20/09/2011
Rv.Global_Sk,1071.971747,D,21/09/2011... (4 Replies)
Discussion started by: csierra
4 Replies
6. Shell Programming and Scripting
Hi guys, i have an executable file that contains several records and fields. One of the records has a variable filed that must be changed each time i want to execute the file. Would it be possible that i can use a loop to change the value of that field? Suppose that the field address is:
Record... (5 Replies)
Discussion started by: saeed.soltani
5 Replies
7. UNIX for Dummies Questions & Answers
Hi !
input:
111|222|333|aaa|bbb|ccc
999|888|777|nnn|kkk
444|666|555|eee|ttt|ooo|ppp
With awk, I am trying to change the FS "|" to "; " only from the 4th field until the end (the number of fields vary between records).
In order to get:
111|222|333|aaa; bbb; ccc
999|888|777|nnn; kkk... (1 Reply)
Discussion started by: beca123456
1 Replies
8. Shell Programming and Scripting
Hello,
I have a file with a date field with various lengths. For example:
m/d/yyyy hh:mm or h:mm
mm/dd/yyyy hh:mm or h:mm
Is there a way using sed or awk to change the field to m/d/y ? I don't need the hours and minutes in that field, just the date in the proper format.
Thanks in... (6 Replies)
Discussion started by: sonnyo916
6 Replies
9. Shell Programming and Scripting
In the awk below I am trying to copy the entire contents of $6 there may be multiple values seperated by a ;, to $8, if $8 is . (lines 1 and 3 are examples). If that condition $8 is not . (line2 is an example) then that line is skipped and printed as is. The awk does execute but prints the output... (3 Replies)
Discussion started by: cmccabe
3 Replies
10. Shell Programming and Scripting
I am trying to use awk to check if each $2 in file1 falls between $2 and $3 of the matching $4 line of file2. If it does then in $5 of file2, exon if it does not intron. I think the awk below will do that, but I am struggling trying to is add a calculation that if the difference is less than 10,... (27 Replies)
Discussion started by: cmccabe
27 Replies