10 More Discussions You Might Find Interesting
1. UNIX for Beginners Questions & Answers
Good day guys,
I'm having trouble in creating a logic when it comes to replacing the values inside a file.
I tried using sed command but it just doesn't work the way I want it to be.
Here is what I'm trying to achieve.
If my input file contains the values below.
NAME++GUEST1 ++GUESS2++... (3 Replies)
Discussion started by: asdfghjkl
3 Replies
2. Shell Programming and Scripting
I have two files which are the output of a multiple choice vocab test (60 separate questions) from 104 people (there are some missing responses) and the question list. I have the item list in one file (File1)
Item,Stimulus,Choice1,Choice2,Choice3,Choice4,Correct... (5 Replies)
Discussion started by: samonl
5 Replies
3. Shell Programming and Scripting
Hi,
I want to replace a chain of if-else statement in an old AWK file with values from Db2 table or CSV file. The part of code is below...
if (start_new_rec=="true"){
exclude_user="false";
user=toupper($6);
match(user, "XXXXX.");
if (RSTART ==2 ) {
... (9 Replies)
Discussion started by: asandy1234
9 Replies
4. Shell Programming and Scripting
I want to replace string values from a file to a file
For eg : File1 has 30 lines of string with values, those specific values needs to be changed in file2 and remaining values in file2 should be as it is.
For example:
From file (File1)
cluster.name=secondaryCluster
To replace File... (9 Replies)
Discussion started by: sriram003
9 Replies
5. Shell Programming and Scripting
Please help me with an shell / awk script to achieve following;
File-1:
ABCDW01 12322 23322
BDADW01 22232 24453
EDFAW00 32232 23422
and so on, notice that the first coloumn is a code and the another file contains the real value of each entry in the first colum above but not in a... (4 Replies)
Discussion started by: digipak
4 Replies
6. UNIX for Dummies Questions & Answers
Hello,
I have two files as shown below:
test1
678
679
689
690
710
test2
1 678
654 800
676 791
689 900
I want to get a count of lines from test2 whose columns bound the values in test1
I tried running the code below; however am getting wrong results. (3 Replies)
Discussion started by: Gussifinknottle
3 Replies
7. UNIX for Dummies Questions & Answers
I have a file in which I want to do multiple find and replace of strings. For a single replace I can implement:
sed -i 's/old/new/' <input_file>
I have a second file that contains the old and the new values like the arbitrary example below:
old new
xyz pqr
ab 756
rst pqr... (3 Replies)
Discussion started by: Gussifinknottle
3 Replies
8. Shell Programming and Scripting
Hi,
using Shell to do some file manipulation here.
Input - input.txt
"2006/2007", "string1a","string2v","stringf3"
"2006/2007", "string12b","string30c","string10d"
"2006/2007", "string22","string22","string11"
"2007/2008", "string1a","string2v","stringf3"
"2007/2008",... (5 Replies)
Discussion started by: pgop
5 Replies
9. Shell Programming and Scripting
Currently I am using the tr command in 3 scenarios for a ksh script.
1) Replacing any spaces in the file with a ~
tr ' ' '~' <$orignalFile> $newFile
2) After certain processing is done at the end of the scirpt i convert the Tilde back to spaces
tr ' ' '~' <$newFile> $newFile2
3) Last... (4 Replies)
Discussion started by: hgjdv
4 Replies
10. Shell Programming and Scripting
Hello,
I have two files that have delimited entries as shown below. I would like to use either Perl or Shell script to extract all the rows in File 1 corresponding to values in File 2 and output it to another File.
File 1
-------
1 36 24 Object1
2 45 36 Object2
3 96 ... (1 Reply)
Discussion started by: Gussifinknottle
1 Replies