10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi Team,
In the below input file, if I have the value 23,24,25 then for those records 1st field value should get updated from "a" to "b". I also want to pass these values in file as input as it can be done dynamically. Tried awk commands but not getting desired output.Using SunOS 5.10 version.... (14 Replies)
Discussion started by: weknowd
14 Replies
2. Shell Programming and Scripting
Hi All,
I am very new to shell scripting and tried to search this in the forum but no luck.
Requirment:
I have an input file which is comma separated. I need to replace the value in 4th column with another value. This has to happen for all the lines in the file.
Sample data:
Input... (2 Replies)
Discussion started by: arunkumarsd
2 Replies
3. Shell Programming and Scripting
Hi All,
I have a file yum.conf that has a field called gpgcheck
this field sometimes has a value of 0 gpgcheck=0 and at other times it has a 1.
I need to check the value and if it is a 1 change it to a 0
any ideas?
thanks,
Gartie (1 Reply)
Discussion started by: gartie
1 Replies
4. Shell Programming and Scripting
Suppose I have a file abc.txt which contain lines:-
11.3.5.7
11.3.6.7
11.6.8.9.10
I want to replace the last field of the line to some value .I want the first line should become 11.3.5.86 .Same applies for rest lines.Please help. (6 Replies)
Discussion started by: maitree
6 Replies
5. Shell Programming and Scripting
Hi everybody,
I'm trying to replace the $98 field with "T" if the last field (108th) is T
I've tried
awk 'BEGIN{OFS=FS="|"} {if ($108=="T")sub($98,"T"); print}' test.txt
but that doesn't do anything
also tried
awk 'BEGIN{OFS=FS="|"}{ /*T.$/ sub($98,"T")} { print}' test.txt
but... (2 Replies)
Discussion started by: jghi123
2 Replies
6. Shell Programming and Scripting
Hi,
I know there are lots of threads on replacing text within files, usually using sed or awk. However, I find it hard to adapt examples that I found to my specific case. I am kind of new to UNIX and have hard times learning the syntax either for sed or awk so I would appreciate any help. Here's... (5 Replies)
Discussion started by: vytenis
5 Replies
7. Shell Programming and Scripting
Wondering if anybody can help with changing the output of a field. I'm needing to change the output of a field in this file:
User Process ID Time Active Licences Type
ChangeAdmin (Phys-agsdev/19353 212), start Wed 1/21 6:30 (linger: 1800)
u414013 (Phys-agsdev/19353 1491), start Wed 1/21 12:54... (5 Replies)
Discussion started by: Glyn_Mo
5 Replies
8. Shell Programming and Scripting
Ok here's my pickle. I have a file in which every line must be the same length. Each field within the line is a certain length. None of these can be changed. What I need to do is look at a specific field within this file, let's say it starts with character 30 and ends with 50. If this field is... (3 Replies)
Discussion started by: DarkHound
3 Replies
9. Shell Programming and Scripting
hi all,
i am having a script file which contains lot of fields and commands.
let's say i have the following word (example1) spread all over the script in every place, how can i replace it with the word (example2)?....the only way i know is to use to either delete the word (example1) and write... (1 Reply)
Discussion started by: charbel
1 Replies
10. Shell Programming and Scripting
Hi,
I wrote a script which extracts data from 2 tables (joining the tables together) and outputs the fields to a csv file.
the output may look something like
scenario 1: a,b,c,d,1,2,3,4 or
scenario 2: a,b,c,d,,,,
now, in the second scenario, there are some empty fields at the end of... (3 Replies)
Discussion started by: Darek
3 Replies