Hi,
I need help with the script below, the if statments are fine they work perfect. what i am looking for is getting the files from the directory /raw/ with the restriction. for example, the filenames under /raw/ directory are,
[HTML]abc.bb.20060101 .gz
abc.bb.20060102 .gz
abc.bb.20080101
abc.bb.20080104[/HTML]I want to get all the files less than the date i type in command line. Also should adapt the script...
User Profile
Collapse
-
help with date extension file reading
-
Kevin,
Thankx again for your response, I appreciate your help. Thanks.
John... -
Kevin thanx for response, Regarding your example your right. $sc can never have more than one set of five fields associated with it. So $sc can have some thing like as below,
[HTML]112311,AB,34353 4
112311,BA,LAN43 5
112311,IS,CA345 33
232323,AB,54334 5
232323,BA,MAN65 4
232323,ET,RTER[/HTML]So what I am looking is grep all "ID(col1),BA,LA N*" first (I need only those IDs that begins with "LAN"...Leave a comment:
-
Thanks for the quick response Kevin, Yaa just because of this rules my script is too slow but your script is amazingly fast. Could you please help me with just one rule say for $ba = `grep "$sc,BA,LAN " $file1`;
Then i will try to work on it.
Thanks in advance
John...Leave a comment:
-
Kevin
I really appreciate your attention. Thanks.
yes thats right has to grep lines that satisfy the conditions for example,
$ba = `grep "$sc,BA,LAN " $file1`;
so first grep all the lines that has ",BA,LAN" which gives all the unique id's (ie columns1 from file1) so based on this id's satisfy rest of the information.
$is = `grep "$sc,IS,LA" $file1`;
$rt = `grep "$sc,RT,.*T O,"...Leave a comment:
-
Kevin
Thankx for the hard work, really appreciate your time and help, works like beauty. Thnx again Kevin. One more thing I have to apply some rules to get the data from file1.csv as shown in the script i posted above for exampl,
$ba = `grep "$sc,BA,LAN " $file1`; # Here i am grabbing those rows which has BA,LAN only. Is there any way i can do this in this same script.
Thankx in advance
...Leave a comment:
-
Hi, thanx for response.
In file1
col1 is "ID" (which could be duplicate), col2 has rows which includes "AB,BA,IS,RT,ET " for these rows i want to create new columns in output as shown in output.txt, and col3 has values of col2. So basically i want output with unique values for all columns and place tab for the null as shown in output.txt,
Please see the output file "output.txt ",
output.txt,...Leave a comment:
-
Kevin Thanks for fast response, No i have not posted this question anywhere else, coz I saw in my search that this the only forum which is active and fast.
About file2.txt, it contains unique columns from file1.csv and I am getting file2 using unix command manually ( I want avoid manual step and do it in perl). The output file as above has new columns which comes out of file1 with column as match. so in the output i dont want any duplicates...Leave a comment:
-
Speed problem
Hi, I am newbie to perl, below is the script i have worked on which gives me exactly what i want. The only problem i am facing is speed. This script is mapping the AB,BA,IS,RT,ET from file1.csv and putting them into columns. file2.txt contains first column of file1.csv which i have cut using unix command (this i would like to avoid and map it from the script itself). my question- Is there any way I can make this script faster as file1.csv has 1.6...
No activity results to display
Show More
Leave a comment: