awk help or any other tool to sort between two files
Experts Good day,
I want to sort two files f1 & f2 to matching with f1's first field with f2's 3rd field like to get in a result file :
I tried with join but getting wrong result, I think there must be something with awk or other unix tool:
cat f1
cat f2
The output to be look like this: (taken only first 5 lines for example).
Earlier I was trying with join, but it was giving few matches only, so wondered ,
I dont know whats wrong with this one, but it produces few lines only n output instead of all matches. Thanks for the help.
---------- Post updated at 02:08 PM ---------- Previous update was at 02:02 PM ----------
This works ,
Thank you.
---------- Post updated at 02:50 PM ---------- Previous update was at 02:08 PM ----------
Scrutinizer,
Unable to understand this part, could you please explain,:
We are matching A[$3] to $1 of file f1 , but you have mentioned $0 , . I am not getting it.
Earlier I was trying with join, but it was giving few matches only, so wondered ,
I dont know whats wrong with this one, but it produces few lines only n output instead of all matches. Thanks for the help.
That is because the files f1 and f2 need to be sorted before being fed to join...
Looking to add text to a file, example
File example;
nodegroups:
check-hosts: L@host.domain.com,host2.domain.com,host3.domain.com
I need to take a file with a one line list of hosts separated by commas
host.domain.com,host2.domain.com,host3.domain.comand prepend the string " ... (6 Replies)
Hi
I have a requirement like below
I need to sort the files based on the timestamp in the file name and run them in sorted order and then archive all the files which are one day old to temp directory
My files looks like this
PGABOLTXML1D_201108121235.xml... (1 Reply)
Hello all -
I am to this forum and fairly new in learning unix and finding some difficulty in preparing a small shell script. I am trying to make script to sort all the files given by user as input (either the exact full name of the file or say the files matching the criteria like all files... (3 Replies)
Hello!
I'm searching for a little (as basic as possible) command -line tool for viewing gif animations.
I found gThumb and animate (imagemagick), but they both have a little problem...
gthumb: no possibility of changing the background when viewing in fullscreen
animate: no possibility of... (0 Replies)
Hi,
nevermind. I think I've found the answer. It appears I was looking for index, match, sub, and gsub.
I want to write a shell script that will clean the html out of a bunch of files and format the data for import into excel.
Awk seems like a powerful tool, but it seems oriented to... (1 Reply)
This is regarding using awk tool to find lines matching between 2 patterns.
cat file | awk '/pat1/,/pat2/'
But it's not working as expected in the following case.
If pat1 also comes after pat2 then it's matching whole file after pat1.
e.g.
# > cat -n file
1 First line... (3 Replies)
I'm working on a program in with shell programming and it needs to be able to delete the contents of files in the Home directory on certain days of the week.(like tuesday). Can anyone help me with this?
Thanks in advance, Taffy. (7 Replies)
Hello all
I wander of there is small utility that gives me the possibility to download direct links to specific folder
say if i have http://www.blah.com/foo.java and I like to download the foo.java without opening the browser and such... (2 Replies)