Search Results

Search: Posts Made By: upstate_boy
2,941
Posted By upstate_boy
I'm not sure if I should create a new thread or...
I'm not sure if I should create a new thread or not - I'm seeing now that before I run the awk script, I need to adjust File1.

Again:
File1:
random-string1
1112
1232
3213
2131...
2,941
Posted By upstate_boy
I see where I went wrong.. my examples were not...
I see where I went wrong.. my examples were not accurate. My apologies.

in file2 (ref.txt) the values look more like this:

File2:
DD 3213
CCA 1231
AA BC 1112
ADFDFF 1232
DDF SCC 2131

I...
2,941
Posted By upstate_boy
Thank you for the quick reply. I apologize if...
Thank you for the quick reply. I apologize if this is a novice question, but so I'm clear, I would run it like this?

file1=master.txt
file2=ref.txt

awk 'FILENAME=="ref.txt"{A[$2]=$1}...
2,941
Posted By upstate_boy
awk - replacing stings in file1 with column1 in file2
Hello,

I've never used awk before, but from what I've read, it will best suit what I'm trying to do. I have 2 files. I need to replace strings in file1 with the first column of a matching string...
2,443
Posted By upstate_boy
Thanks Thegeek - that's what I needed.
Thanks Thegeek - that's what I needed.
2,443
Posted By upstate_boy
Thanks for the suggestion Varontron. I tried it...
Thanks for the suggestion Varontron. I tried it but it's not producing the output I need. Here's what I'm getting now:

all files containing string 1
all files containing string 2
all files...
1,470
Posted By upstate_boy
I'm not one of the experts, but I think this will...
I'm not one of the experts, but I think this will work for you:

grep -f 'computernamefile.txt' * >> output.txt

tip: make sure there are no blank lines in your input file.
2,443
Posted By upstate_boy
Help with grep output
Hello,

I have a list of stings that I'm using with grep to determine which files contain the strings. Here's what I have now:

list of strings in a file (list.txt):
/directory/direc...
2,218
Posted By upstate_boy
Help removing strings from one file that match any of the values in a second file.
Hello,

I have a file that lists a few hundred values.

Example:

abca
abcb
abcc
abcd

I have a 2nd file with a few thousand lines. I need to remove every line from the 2nd file that...
30,954
Posted By upstate_boy
Problem found. I feel kind of foolish now but...
Problem found. I feel kind of foolish now but after so many people offered help and suggestions I feel you should see my error.

My strings.txt file had several blank lines in it prior to and...
30,954
Posted By upstate_boy
Era - I'm not sure how to inspect in the way you...
Era - I'm not sure how to inspect in the way you are asking but I've deleted the stings.txt and created a new one with vi adding the string back - no copy/paste. When trying grep -rl -f strings.txt...
30,954
Posted By upstate_boy
I tried grep -rl -f strings.txt /path/to/search/*...
I tried grep -rl -f strings.txt /path/to/search/* > result.txt

Same problem, the string in strings.txt is being split up:


/sample/string in/strings file/title.jsp

I'm guessing it is being...
30,954
Posted By upstate_boy
Thanks for the suggestion Franklin52. I do see...
Thanks for the suggestion Franklin52. I do see the echo showing the full string now, but the results of the grep are off.

If I do the grep manually - I get 3 files returned which is correct.
...
30,954
Posted By upstate_boy
Jim, thanks for spelling it out for me. I got it...
Jim, thanks for spelling it out for me. I got it to work but it's not producing the results I need. The results going to the results.txt are the actual contents of the files, and they are not...
30,954
Posted By upstate_boy
I've changed it to: find /directory/I/want...
I've changed it to:

find /directory/I/want to/search/ -type f | \
while read file
do
grep -f strings.txt $results.txt
done

Results now are:

grep: .txt: No such file or directory
...
30,954
Posted By upstate_boy
Thank you both for the replies. I don't think...
Thank you both for the replies. I don't think I'm executing your suggestions correctly, I've tried all 3.

Jim,

I'm definately confused by which files go where when I read yours.

assume:...
30,954
Posted By upstate_boy
Recursive grep
Hello,

First time post - I have no formal unix training and could use some help with this. I have a list of strings in File1 that I want to use to do a recursive search (grep) under a specific...
Showing results 1 to 17 of 17

 
All times are GMT -4. The time now is 11:10 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy