11-22-2012
Delete file2.txt from file1.txt using scripting
Hi,
I`m a total newbie, well my requirement is that i have 2 files
I want to identify which countries i do not currently have in db..
how can i use the grep or another command to find this file ..
i want to match all-countries.txt with countries-in-db.txt so the output is equal to countries which are not currently in my db?
any command that i can use to achieve this would be helpful
Thanks
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I've been searching around here and other places, but can't put this together...
I've got a unique list of words in file 1 (one word on each line).
I need to delete each line in file2 that begins with the word in file1.
I started this way, but want to know how to use file1 words instead... (13 Replies)
Discussion started by: michieka
13 Replies
2. UNIX for Dummies Questions & Answers
Hi Guru's,
I need to create 3 files with the contents "ABC" using single command.
Iam using:
echo "ABC" > file1.txt file2.txt file3.txt
the above command is not working. pls help me...
With Regards / Ganapati (4 Replies)
Discussion started by: ganapati
4 Replies
3. Shell Programming and Scripting
I have one base file, and multiple target files-- each have uniform line structure so no need to use grep to find things-- can just define sections by line number.
My question is quite simple-- can I use sed to copy a defined block of lines (say lines 5-10) from filename1.txt to overwrite an... (3 Replies)
Discussion started by: czar21
3 Replies
4. UNIX for Dummies Questions & Answers
I have a diff command that does what I want but when comparing large text/log files, it uses up all the memory I have (sometimes over 8gig of memory)
diff file1.txt file2.txt | grep '^<'| awk '{$1="";print $0}' | sed 's/^ *//'
Is there a better more efficient way to find the lines in one file... (5 Replies)
Discussion started by: raptor25
5 Replies
5. Shell Programming and Scripting
Hi All,
I have a file1.txt where the index of the columns are placed. I want to get the columns from file2.txt corresponding to these index numbers.
I was usually using
awk '{print $5, $6, $2, $3, ...}' file2.txt > output.txt
However, this list is very long. So, i want to read the... (4 Replies)
Discussion started by: senayasma
4 Replies
6. Shell Programming and Scripting
This is appending a column.
My question is fairly simple. I have a program generating data in a form like so:
1 20
2 22
3 23
4 12
5 43
For ever iteration I'm generating this data. I have the basic idea with cut -f 2 fileA.txt | paste -d >> FileB.txt ???? I want FileB.txt to grow, and... (4 Replies)
Discussion started by: theawknewbie
4 Replies
7. Shell Programming and Scripting
Hi All,
I have to arrange one of the text file by deleting specific lines.
cat file1.txt
3595 3595 -0.00842773 -0.0085077 0.00368851
12815 12815 -0.00929239 0.00439785 0.0291697
3747 3747 -0.00974353 0.00228922 0.0225058
3574 3574 -0.00711399 -0.00315748 0.0141206
....
12734... (7 Replies)
Discussion started by: senayasma
7 Replies
8. UNIX for Dummies Questions & Answers
I have very limited coding skills but I'm wondering if someone could help me with this. There are many threads about matching strings in two files, but I have no idea how to add a column from one file to another based on a matching string.
I'm looking to match column1 in file1 to the number... (3 Replies)
Discussion started by: pathunkathunk
3 Replies
9. Shell Programming and Scripting
I want to add/append the info in the following format to my.txt file.
20130702|abcd20130702.txt FN|SN|DOB
I tried the below script but it throws me some exceptions.
<#!/bin/sh
dt = date '+%y%m%d'members;
echo $dt+|+members+$dt;
/usr/bin/awk -f
BEGIN { FS="|"; OFS="|"; } { print... (6 Replies)
Discussion started by: harik1982
6 Replies
10. Shell Programming and Scripting
Dear all,
I have a huge txt file (DATA.txt) with the following content . From this txt file, I want the following output using some shell script.
Any help is greatly appreciated.
Greetings,
emily
DATA.txt (snippet of the huge text file)
407202849... (2 Replies)
Discussion started by: emily
2 Replies
LEARN ABOUT PHP
gregoriantojd
GREGORIANTOJD(3) 1 GREGORIANTOJD(3)
gregoriantojd - Converts a Gregorian date to Julian Day Count
SYNOPSIS
int gregoriantojd (int $month, int $day, int $year)
DESCRIPTION
Valid Range for Gregorian Calendar 4714 B.C. to 9999 A.D.
Although this function can handle dates all the way back to 4714 B.C., such use may not be meaningful. The Gregorian calendar was not
instituted until October 15, 1582 (or October 5, 1582 in the Julian calendar). Some countries did not accept it until much later. For exam-
ple, Britain converted in 1752, The USSR in 1918 and Greece in 1923. Most European countries used the Julian calendar prior to the Grego-
rian.
PARAMETERS
o $month
- The month as a number from 1 (for January) to 12 (for December)
o $day
- The day as a number from 1 to 31
o $year
- The year as a number between -4714 and 9999
RETURN VALUES
The julian day for the given gregorian date as an integer.
EXAMPLES
Example #1
Calendar functions
<?php
$jd = GregorianToJD(10, 11, 1970);
echo "$jd
";
$gregorian = JDToGregorian($jd);
echo "$gregorian
";
?>
SEE ALSO
jdtogregorian(3), cal_to_jd(3).
PHP Documentation Group GREGORIANTOJD(3)