01-28-2009
I am sorry to say but i dint understand anything....
I dont want to compare file and remove duplicates....i want to cheack if that pattern is already present in the file then remove it and replace it with the input....if not just place the input...
The partten here CUR_MAINT_DATE... i want something with grep, sid and awk...
Thanks for the help
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
hi
i have records in my input file like this
aaa|1234||2bc||rahul|tamilnadu
bba|2234||b4c||bajaj|tamilnadu
what i am expecting is in between two pipes if there is no character it should be replaced with null or 0
so my file will look like this
aaa|1234|null|2bc|0|rahul|tamilnadu... (4 Replies)
Discussion started by: trichyselva
4 Replies
2. UNIX for Dummies Questions & Answers
Ok, I am brand new to UNIX and I am trying to learn a cross between basic script and database use. I had got some ideas off the net on simple ideas for learning UNIX. I am working on creating a simple phone book program that allows myself to enter our employees from work into a phone book text... (0 Replies)
Discussion started by: georgefurbee
0 Replies
3. Shell Programming and Scripting
All,
I am trying to figure out a script to run in windows that will allow me to match on First column in file1 to 8th Column in File2 then
Insert file1 column2 to file2 column4 then create a new file.
File1:
12345 Sam
12346 Bob
12347 Bill
File2:... (1 Reply)
Discussion started by: darkoth
1 Replies
4. Shell Programming and Scripting
Hi,
I have two files , one file with data file with attributes that need to be sent to another file to generate a predefined format.
Example:
File.txt
AP|{SSHA}VEEg42CNCghUnGhCVg==
APVG3|{SSHA}XK|"password"
AP3|{SSHA}XK|"This is test"
....
etc
---------
test.sh has... (1 Reply)
Discussion started by: hudson03051nh
1 Replies
5. Shell Programming and Scripting
Hi,
i have 2 input files which are file1.txt and file2.txt. I need to extract data from file1.txt and file2.txt and save it in file3.txt like example below:-
File1.txt
ID scrap1
Name scrap1
start 1
end 10
ID scrap2
Name scrap2
start 11
end ... (4 Replies)
Discussion started by: redse171
4 Replies
6. Shell Programming and Scripting
Hi All,
I have two input file and need to generate a CSV file. The existing report just "GREP" the records with the Header and Tailer records with the count of records.
Now i need to split the data into 25 records each in the same CSV file.
id_file (Input file )
227050994
232510151... (4 Replies)
Discussion started by: rasmith
4 Replies
7. Shell Programming and Scripting
Hi All,
how can i edit my original data and add more data if my 2nd script outputs SUCESS?
ex.
input file:
1.txt
nik,is,the
1script.sh
if 2ndscript.sh output SUCCESS then i'm going to edit my input file and add data best,pogi..
sample outputdata.
nik,is,the,best,pogi
2ndscript.sh... (3 Replies)
Discussion started by: nikki1200
3 Replies
8. Shell Programming and Scripting
Hello,
I have 2 files delimited by "|".
File1:
1|New York
12| Buffalo
599| Syracuse
File2:
56 Kennedy |1
9 Burridge Pl|15
98 BELL ROCK |599
My goal: Is to replace the numerical numbers in "File 2" (second field, not street address) with the corresponding city names from... (2 Replies)
Discussion started by: vestport
2 Replies
9. Shell Programming and Scripting
this section of the awk code i have here takes file to work with from the user.
the user specifies the file name from the command line and the file name is assigned to the variable $FLIST
awk 'BEGIN {
while((getline < "'${FLIST}'")>0)
S
FS="\n"; RS="}\n"
}
now, i dont want... (5 Replies)
Discussion started by: SkySmart
5 Replies
10. Shell Programming and Scripting
The below awk improved bu @MadeInGermany, works great as long as the input file has data in it in the below format:
input
chrX 25031028 25031925 chrX:25031028-25031925 ARX 631 18
chrX 25031028 25031925 chrX:25031028-25031925 ARX 632 14... (3 Replies)
Discussion started by: cmccabe
3 Replies
GREP(1) General Commands Manual GREP(1)
NAME
grep - search a file for a pattern
SYNOPSIS
grep [ option ... ] pattern [ file ... ]
DESCRIPTION
Grep searches the input files (standard input default) for lines (with newlines excluded) that match the pattern, a regular expression as
defined in regexp(6). Normally, each line matching the pattern is `selected', and each selected line is copied to the standard output.
The options are
-c Print only a count of matching lines.
-h Do not print file name tags (headers) with output lines.
-i Ignore alphabetic case distinctions. The implementation folds into lower case all letters in the pattern and input before interpre-
tation. Matched lines are printed in their original form.
-l (ell) Print the names of files with selected lines; don't print the lines.
-L Print the names of files with no selected lines; the converse of -l.
-n Mark each printed line with its line number counted in its file.
-s Produce no output, but return status.
-v Reverse: print lines that do not match the pattern.
Output lines are tagged by file name when there is more than one input file. (To force this tagging, include /dev/null as a file name
argument.)
Care should be taken when using the shell metacharacters $*[^|()= and newline in pattern; it is safest to enclose the entire expression in
single quotes '...'.
SOURCE
/sys/src/cmd/grep.c
SEE ALSO
ed(1), awk(1), sed(1), sam(1), regexp(6)
DIAGNOSTICS
Exit status is null if any lines are selected, or non-null when no lines are selected or an error occurs.
GREP(1)