10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
I have several problems with my problems: I hope you can help me.
1) the If else statement I am getting an error message. My syntax must be incorrect because the entire statement is throwing an error.
For example in filew.log if these items don't exist Memsize, SASFoundation and also if... (0 Replies)
Discussion started by: dellanicholson
0 Replies
2. Shell Programming and Scripting
I have a file containing multiple values, some of them are pipe separated which are to be read as separate values and some of them are single value all are these need to store in variables.
I need to read this file which is an input to my script
Config.txt
file name, first path, second... (7 Replies)
Discussion started by: ketanraut
7 Replies
3. Shell Programming and Scripting
I'm trying to use awk to do the following. I have file1 with many lines, each containing 5 fields describing an individual set. I have file2 which is a template config file with variable space holders to be replaced by the values in file1. I would like to substitute each set of values in file1 with... (6 Replies)
Discussion started by: msmehaffey
6 Replies
4. Shell Programming and Scripting
Hi,
I have a huge file that has data something like shown below:
huge_file.txt
start regexp
Name=Name1
Title=Analyst
Address=Address1
Department=Finance
end regexp
some text
some text
start regexp
Name=Name2
Title=Controller
Address=Address2
Department=Finance
end regexp (7 Replies)
Discussion started by: r3d3
7 Replies
5. UNIX for Dummies Questions & Answers
Hi,
I am using the following code to change NA to X in only the 5th column of my text file:
awk '{gsub("NA","x",$5)}1' in.file > out.file
How can I modify this code if I want to change NA to X in multiple columns of the text file (i.e. columns 5,6 and 7). Thanks! (2 Replies)
Discussion started by: evelibertine
2 Replies
6. Shell Programming and Scripting
Hi,
I am trying to execute this line
awk -F ";" -v OFS=";" '{gsub(/\./,",",$6); print}' FILE
but for multiple fields $6 $7 $8
Do you have a suggstion?
Tried:
awk -F ";" -v OFS="";"" "function GSUB( F ) {gsub(/\./,\",\",$F); print} { GSUB( 6 ); GSUB( 7 ); GSUB( 8 ) } 1"... (2 Replies)
Discussion started by: nakaedu
2 Replies
7. Shell Programming and Scripting
Hello,
For the input file, I am trying to split those records which have multiple values seperated by '|' in the last input field, into multiple records and each record corresponds to the common input fields + one of the value from the last field.
I was trying with an example on this forum... (4 Replies)
Discussion started by: imtiaz99
4 Replies
8. Shell Programming and Scripting
Hi all.
I have the following command that is successfully searching for any one of the strings on all lines of a file and replacing it with the instructed value.
cat inputFile | awk '{gsub(/aaa|bbb|ccc|ddd/,"1234")}1' > outputFile
This does in fact replace any occurrence of aaa, bbb,... (2 Replies)
Discussion started by: dazhoop
2 Replies
9. Shell Programming and Scripting
Hi,
first, I have searched in the forum for this, but I could not find the right answer. (There were some similar threads, but I was not sure how to adapt the ideas.)
Anyway, I have a quite natural problem: Given are several text files. All files contain the same number of lines and the same... (3 Replies)
Discussion started by: rbredereck
3 Replies
10. Shell Programming and Scripting
I got a file with contents are of the following format
...
2007-09-28 ./.passwwd1.sh.swp
2007-11-26 ./827-55.jpg
2007-09-28 ./argcheck.pl
...
I have to delete all the '-' in the "first field", ie. the date, not on the second field, which is the name of the file.
i.e.
required output
... (1 Reply)
Discussion started by: jaduks
1 Replies