i need only shell script or perl as mine supports that only.
i should not read line by line beacuse if 5 lakh records are there it will take long time.
i think about a scenario could any one help in getting it in a script..
test.txt - main file
test.txt
=======
1. find first level of format check...in this 2013/12/12 or 2013/23/43 0r 2013-13-32 or 2013-12-43 like this will and be be captured
2.seperate feb into one file
feb file name is now feb.txt
i have to split feb.txt into two files( leap.txt and nonleap.txt)
leap.txt
=======
nonleap.txt
=======
but how to to split the leap year dates and non leap year dates in tow files
3.seperate APR,june,sep,nov into one file
APR,june,sep,nov file name is now 30day.txt
finally after all validation if the vijay.txt has a N, it means a invalid date has been found in some check ..
finally i will tell the main file is invalid.
please help me out for this scenario by a script.
Last edited by Franklin52; 11-13-2013 at 03:20 AM..
Reason: Please use code tags
Putting code or output into CODE tags makes it a lot more readable. Can you edit your post to put them in please.
You also seem to be persisting with your original costly code which fires up all sorts of processes (cut, cat, sort, etc.). Can you show me the errors you are getting with my offering or why it is unacceptable. I can then try to help.
Reading the unformatted block of text, you seem to like my grep so I'd like to know how I can improve the rest.
It would be nice if you wrap the output in CODE tags. It makes it so much easier to read for such little effort. Simply highlight the output or code, then on the toolbar of the little editing window, press the white square that has "co" over "de", between the speech bubble and the page with "php" on it.
Alternatively, add the text [CODE] before the text and [/CODE] afterwards manually.
Complaint over.
Perhaps I should have said that this is a shell script and not to be pasted to the command line. Can you save it all in a file. Let's call it datescan as an example and then do the following on the command line:-
What output (remember the CODE tags) do you get from that?
so i have scripts that get run in ways similar to this:
cat script.pl | perl - $1 $2 $3
cat script.rb | ruby - $1 $ 2 $3
my question is, how can i verify that that the "perl" or "ruby" or "python" tool being run on the box is actually a legit tool? meaning, someone may move the tool from... (2 Replies)
hello,
in a file exist entries in date format YYYYMMDD. i want to find out, if there are dates, which isn't today's date.
file:
date example text
20140714 <= not today's date
20140715 <= not today's date
20140716 <= today's date
my idea is to use Perderabo's datecalc
... (2 Replies)
Hi Experts,
I am checking how to get day in Perl.
If it is “Monday” I need to process…below is the pseudo code.
Can you please prove the code for below condition.
if (today=="Monday" )
{
while (current_time LESS THAN 9:01 AM)
... (1 Reply)
Hi,
In a field, I should receive the date with time stamp in a particular field. But sometimes the vendor sends just the date or the timestamp or correctl the date×tamp. I have to figure out the the data is a date or time stamp or date×tamp.
If it is date then append "<space>00:00:00"... (1 Reply)
hi there
I have file names in different format as below
triss_20111117_fxcb.csv
triss_fxcb_20111117.csv
xpnl_hypo_reu_miplvdone_11172011.csv
xpnl_hypo_reu_miplvdone_11-17-2011.csv
xpnl_hypo_reu_miplvdone_20111117.csv
xpnl_hypo_reu_miplvdone_20111117xfb.csv... (10 Replies)
Hi,
I have to validate the passwords for 100s of unix users across several servers. I have the list of unix users and servers with passwrods.
How can I check whether a password is correct or not using a single shell script?
Note : I do not have root privileges on any server. All the... (1 Reply)
How to validate the first line from 1-8 position of audit file that contains the script run date... script could run in random dates.
head -1 file1
20090516 100034837SHDHSHE (9 Replies)
Hi folks,
I need to write a script that should activate a process according to the current hour.
The process should be activatet only if the hour is between midnight (00:00) and 07:00.
How should I create the condition?
Thanks in advance,
Nir (2 Replies)
hi, i'm trying to write a script to check if the home directories of users are set correctly. below is an extract of the script
here, i am trying to put the name of the owner of the home directory into the variable dirperm (by reading lines in /etc/passwd). however, it seems that when the... (1 Reply)
Hey, I was wondering how I could write a bash script which accepts:
cat <<% | bash ./results06
----------------------------------------------------------
Exam Results 2006
----------------------------------------------------------
... (1 Reply)