I'm having problems

I'm having problems

Post by steven_31 » Tue, 02 May 2000 04:00:00



Hello, I want to select lines  in file_2 using id numbers from file_1.
In file-2 feilds are separated by a single tab. I've tried what I know,
which isn't much.

file_1

2345
5678
9876

file_2

1233    fgfgjdgj        5433653 7897897
2345    hfhsygaa        4354464 4557766
6578    edetvnba        4655454 4446566
5678    mnnbcvbb        5465655 6676767
9012    ereefgfg        4545665 7556757
9876    sfdsgfg5        4656565 5656553

Thanks in advance

 
 
 

I'm having problems

Post by Tim Goodw » Tue, 09 May 2000 04:00:00




>Hello, I want to select lines  in file_2 using id numbers from file_1.
>In file-2 feilds are separated by a single tab. I've tried what I know,
>which isn't much.

Sounds easy enough.  Try this, where `<tab>' is a literal tab character.

    for i in `cat file_1`; do
            grep "^$i<tab>" file_2
    done

Tim.
--
Tim Goodwin   | "If you don't know what closures are, you probably don't
Leicester, UK | want to know what closures are." -- Larry Wall

 
 
 

1. having problems with 'find' command

Hi all,

i'm having a lot of problems with 'find', and I get the
feeling they are well known problems, I was wondering if
anyone would be able to help me out. The problem is that
the -local switch doesn't seem to work. It reads the
file /etc/dfs/dfstypes or something like that for a list
of remote file system types, and is SUPPOSED to skip the
file systems of those types when searching, but it
doesn't. I have tried various ways to get around this,
including -fstype nfs -prune. I can't seem to get it to
work! All I want is to have 'find' search the hard drives
for core files and remove them.

Any help is appreciated.
Thanks,
Alim.

2. Has NETREK been ported to Linux?

3. Some problems I've been having with REDhat 3.03 (I'm a newbie)

4. How to run two or more apache on the same box ?

5. Having problems w/ 'disksetup' on IDE drives

6. Dump and restore for Linux?

7. I'm having host problems (null)~# and SLIP problems

8. Proxy ARP with 1.0.9?

9. Users having probs logging into Linux system, get '/home/...' doesn't exist.

10. Having Problems with 2 NE2000 NIC's

11. we're having a lot of problems with mutual file corrupting on the disk

12. I'm having just a couple of problems with mail :)

13. Can someone help me with the a problem I'm having with DIP