LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   how can I search a file to find if my variable belogs to a field (https://www.linuxquestions.org/questions/linux-newbie-8/how-can-i-search-a-file-to-find-if-my-variable-belogs-to-a-field-881389/)

thomai 05-18-2011 07:54 AM

how can I search a file to find if my variable belogs to a field
 
good afternoon to you all,sorry for my english
I'am new in your forum as in the linux command so I would appreciate your help

I have a file that contains 5 fields and anothen one with two
I want to take the value from user and search file1 and if the value exists then write in file2 to the $2 to the line that $1=value

file 1
1:fsdfsd:g:33:fsdf
2:yytgdcf:a:3:sgd
3:tttt:g:67:yujhggfg
4:rgtdfrg:g:34:gdfhf

file 2
1:2
5:3

grail 05-19-2011 01:18 AM

Please do not double post as it is against the LQ rules.

Previous post : http://www.linuxquestions.org/questi...iables-881417/

I have requested this one be closed

Tinkster 05-19-2011 05:54 PM

Please post your thread in only one forum. Posting a single thread in the most relevant forum will make it easier for members to help you and will keep the discussion in one place. This thread is being closed because it is a duplicate.


All times are GMT -5. The time now is 05:35 PM.