Search Results

Search: Posts Made By: castrojc
1,297
Posted By castrojc
Jim I got the following error message: ./junk:...
Jim I got the following error message:
./junk: line 4: cd: dir2: No such file or directory .......(yes I do have a directory->dir2)
awk: NR==FNR {arr[$0]++; next} {arr[$[0]++; next}
awk: ...
1,297
Posted By castrojc
I have not tried the code given by Jim McNamara...
I have not tried the code given by Jim McNamara yet, but to clarify for don... Basically if ANY "item" from file1, file2, file3 appear in ANY of the files of dir2, then I do not care for those...
1,297
Posted By castrojc
How to check "item" is in multiple files?
I have multiple files:

file1:
one
two
three

file2:
two
four
six

file3:
one
two
ten

These are all in a directory called dir1
3,575
Posted By castrojc
ahh, i see. I thought FILENAME was my file,...
ahh, i see. I thought FILENAME was my file, thanks for clarifying
3,575
Posted By castrojc
I'm sorry but I still cannot get it to work,...
I'm sorry but I still cannot get it to work, would you be able to use my filenames in the example given? I am having trouble with the filename part
3,575
Posted By castrojc
I tried following the code along, but I couldn't...
I tried following the code along, but I couldn't understand it or get it to work. Can you update it using these files as an example please?


file1:
one
two
three



file2:
one
two
three...
3,575
Posted By castrojc
Compare multiple files, and extract items that are common to ALL files only
I have this code


awk 'NR==FNR{a[$1]=$1;next} a[$1]' file1 file2


which does what I need it to do, but for only two files. I want to make it so that I can have multiple files (for example 30)...
1,845
Posted By castrojc
Compare two files, then overwrite first file with only that in both files
I want to compare two files, and search for items that are in both. Then override the first file with that containing only elements which were in both files. I imagine something with diff, but not...
2,031
Posted By castrojc
ahh, I see. Thank you both
ahh, I see. Thank you both
2,031
Posted By castrojc
Thanks, now what if I want to change the number...
Thanks, now what if I want to change the number from 105? Is there a way to make that number a variable instead?
2,031
Posted By castrojc
How to search for numbers greater than x?
I have a file with multiple fields, example below


File 1:

Field 1|Field 2|Field 3|Field 4|Field 5|Field 6|Field 7|100
Field 1|Field 2|Field 3|Field 4|Field 5|Field 6|Field 7|101
Field...
1,483
Posted By castrojc
perfect, thanks!
perfect, thanks!
1,483
Posted By castrojc
How to add day of week at the end of each line that shows the date?
I have a file that looks like:


file1:
www_blank_com 20121008153552
www_blank_com 20121008162542
www_blank_com 20121009040540
www_blank_com 20121009041542
www_blank_com 20121010113548...
2,319
Posted By castrojc
Ok so ironically enough, I found an error with...
Ok so ironically enough, I found an error with both of these scripts, but they do different things. Both of them start messing things up once there are 10 or more unique words. ex:
using the file:
...
2,319
Posted By castrojc
nevermind, I typed it wrong, it did work! thanks...
nevermind, I typed it wrong, it did work! thanks alot!
2,319
Posted By castrojc
wow that worked, however, I ran into some trouble...
wow that worked, however, I ran into some trouble again. I added the word "ape" and extra few times and it did not give me the outcome I want:


cat 3
cat 7
cat 1
dog 3
dog 5
dog 9
dog 1...
2,319
Posted By castrojc
That worked for the example I gave but I do not...
That worked for the example I gave but I do not believe it does what I want it to do, I may have mislead my question by having my outcome be in reverse alphabetical order. That is only a coinsodence,...
2,319
Posted By castrojc
How can I sort by n number is like words?
I want to sort a file with a list of words, in order of most occuring words to least occurring words as well as alphabetically.

ex:

file1:
cat 3
cat 7
cat 1
dog 3
dog 5
dog 9
dog 1
ape...
1,251
Posted By castrojc
How can I use my code to gather information from a file in a completely different directory?
I need my code to compare two different files that are in two completely different directories, How can I do this?

So for example, my code will look at file1 which is in my home directory, and...
834
Posted By castrojc
Example: file1: oranges apple water ...
Example:

file1:
oranges
apple
water
time
machine

file2:
water
ryan
king
apple
oranges

Desired output:
time
machine
834
Posted By castrojc
How can I set up this loop?
I want to compare two files. I think using grep is the way to go but I do not know how to set this up. Let me show an example:
File1 has 1000 items, File2 has 700 items
I need to take the first...
Showing results 1 to 21 of 21

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