Search Results

Search: Posts Made By: spirm8
1,406
Posted By ctsgnb
Just for your information, this can also be done...
Just for your information, this can also be done using the dos2unix command
1,406
Posted By ctsgnb
vi test.txt :%s/.*/&@test.com/when in vi in...
vi test.txt

:%s/.*/&@test.com/when in vi in command mode, use
:set listto enable the display of invisible caracter
:set nolistto disable the display of invisible caracter
1,406
Posted By Scrutinizer
@spirm8, your sed statement is correct and it...
@spirm8, your sed statement is correct and it should not be doing that. There probably is something wrong with the input file. What platform are you on, how did you create the input file.
Also,...
8,722
Posted By ygemici
# for i in `sed "" file2`; do sed "/$i/d" file1...
# for i in `sed "" file2`; do sed "/$i/d" file1 1>testf && mv -f testf file1; done ; more file1
4
5
6


# comm -3 file2 file1
4
5
6

# diff file2 file1 | sed...
8,722
Posted By Scrutinizer
Strange. With your input I get: 4 5 6 ...
Strange. With your input I get:
4
5
6

--

With the samples you provided, this should work too:
grep -vf file2 file1
8,722
Posted By Scrutinizer
IMO franklin's suggestion just needs a print $2...
IMO franklin's suggestion just needs a print $2 action. Plus I would tend to use $1 instead of $0 in the first part to avoid possible mismatches due to spurious spacing...
awk 'NR==FNR{a[$1];...
8,722
Posted By Franklin52
If your grep version supports the -f option: ...
If your grep version supports the -f option:
grep -f file1 file2

Otherwise with awk:
nawk 'NR==FNR{a[$0]; next}$1 in a' file1 file2
Showing results 1 to 7 of 7

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