10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
Hello
I am trying to conditionally replace field content in $2 of input file if pattern is found in $4 of the same tab-separated input file. Currently, $2 is empty. I am trying (with no success):
awk -F "\t" 'BEGIN {FS="\t"}{ if ($4=="NO") $2=$2"NO"; print $0}' in > out (2 Replies)
Discussion started by: dovah
2 Replies
2. Windows & DOS: Issues & Discussions
so...
Lets assume I have a text file.
The text file contains multiple "#" symbols.
I want to replace all thos "#"s with a STRING using DOS/Batch
I want to add a certain TEXT to the end of each line.
How can I do this WITHOUT aid of sed, grep or anything linux related ? (1 Reply)
Discussion started by: pasc
1 Replies
3. Shell Programming and Scripting
I have very large perl source code file and I want to replace every occurrence function say foo,The function foo has some arguments and I want to replace 2nd argument,the current argument is hex integer and i want to replace it to equivalent string.Also I want to replace function name foo with... (4 Replies)
Discussion started by: pravint
4 Replies
4. Shell Programming and Scripting
Hi,
How to replace only the function calls with a new name and skip the function definition and declarations. consider the following code.
There are 2 functions defined here returnint and returnvoid.
I need to replace returnint with giveint and returnvoid with givevoid only in the function... (2 Replies)
Discussion started by: i.srini89
2 Replies
5. UNIX for Dummies Questions & Answers
Hi,
How to replace only the function calls with a new name and skip the function definition and declarations. consider the following code.
There are 2 functions defined here returnint and returnvoid.
I need to replace returnint with giveint and returnvoid with givevoid only in the function... (1 Reply)
Discussion started by: i.srini89
1 Replies
6. Shell Programming and Scripting
Hi! I'm trying to take multiple text files (6), which have text on some lines but not others, and combine them. I'd also like to make the values in one column of some of the files (files 4-6) negative. I'm trying to write a short script (see below) as I have to do this with a large number of... (2 Replies)
Discussion started by: felix.echidna
2 Replies
7. Shell Programming and Scripting
Hi All,
I have a file as below:
cat myfile
abcdef
NA
rwer
tyujkl
na
I wish to add the text ".txt" at the end of all lines except the lines starting with NA or na.
I know i can add text at the end of line using following command but I am not sure how to valiate the condition. (14 Replies)
Discussion started by: angshuman
14 Replies
8. Shell Programming and Scripting
I am currently writing a script to compare a file list created over an FTP connection to a local directory.
I have cleaned the FTP file list up so that I just have a raw list of filenames however due to the directory structure employed (both locally and on the ftp site) I need to prepend each line... (6 Replies)
Discussion started by: Dal
6 Replies
9. Shell Programming and Scripting
I am trying to write a shell script that will allow the typing of a value, then using that value to replace data in a text file.
I suspect I need sed.
The format of the file is:
Variable1:Value1
Variable2:Value2
The interaction would be something like:
Shell Prompt: "Please enter the... (9 Replies)
Discussion started by: cleanden
9 Replies
10. UNIX for Dummies Questions & Answers
I have a text file with following content (3 lines)
filename : output.txt
first line:12/12/2008
second line:12/12/2008
third line:Y
I would like to know how we can replace 'Y' with 'N' in the 3rd line keeping 1st and 2nd lines same as what it was before.
I tried using cat output.txt... (4 Replies)
Discussion started by: santosham
4 Replies