Search Results

Search: Posts Made By: worchyld
Forum: Web Development 06-10-2009
2,699
Posted By worchyld
Many thanks, I have resolved the issue by another...
Many thanks, I have resolved the issue by another means.

Thanks again!
Forum: Web Development 05-02-2009
2,699
Posted By worchyld
MySQL: Random offers for every airport
I need to write a MySQL query where it loops through every airport and generates 10 random offers (my offers table is 990,000+ rows)

The code I have below works for 1 airport, but as soon as it...
16,695
Posted By worchyld
I know that .. I replace it with the path I use. ...
I know that .. I replace it with the path I use. I'm going to try again with making a date command inside a .sql file, and hopefully I can resolve the issue.
16,695
Posted By worchyld
I've tried it this on the actual .sql file which...
I've tried it this on the actual .sql file which holds the load data stuff;


LOAD DATA LOCAL INFILE '/path/to/inbounddata/data/$(date +%Y-%m-%d)/traveldata.csv'


But I get this error;


...
16,695
Posted By worchyld
$ echo "LOAD DATA LOCAL INFILE...
$ echo "LOAD DATA LOCAL INFILE '/path/to/inbounddata/data/$(date +%Y-%m-%d)/traveldata.csv'"
LOAD DATA LOCAL INFILE '/path/to/inbounddata/data/2009-03-13/traveldata.csv'


Hey, that worked great...
16,695
Posted By worchyld
Putting dates into paths
I've now had the chance to test this, it does indeed work! Thanks a lot! I want to thank you for your help, I really appreciate it. My CSV file extracts its contents into a date-based folder...
16,695
Posted By worchyld
Thanks for clarification! I appreciate it!
Thanks for clarification! I appreciate it!
16,695
Posted By worchyld
Can you could use this command to load CSV files?...
Can you could use this command to load CSV files? I'm going to investigate this.

The problem I see is that my CSV file isn't a SQL query, and secondly I do not have any control over the contents...
16,695
Posted By worchyld
Oh, I will try your solution with a dummy table...
Oh, I will try your solution with a dummy table and hopefully it will work!

Thanks!
10,236
Posted By worchyld
I tried your code twice and it never deleted...
I tried your code twice and it never deleted anything.

But I noticed you used a * at the end of your /data/ and tried in on a previousily mentioned code and it seems to be working;


find...
10,236
Posted By worchyld
uname -a Produces: echo $0 ...
uname -a


Produces:



echo $0


Produces:



find /path/to/data/ -depth ! -name data -type d -ctime 0 -exec echo {} > /path/to/test \;


With my setup produces:
16,695
Posted By worchyld
Oh, I didn't know that. Am I right in...
Oh, I didn't know that.

Am I right in thinking all I need to do is rename the CSV filename to match the table and then do the mysqlimport?

I've done some tests, I do not have the right...
10,236
Posted By worchyld
I've checked the path, I even tried it three...
I've checked the path, I even tried it three times in different folders -- but it still removes the data folder.


find ~/inbounddata/data/ -depth ! -name data -type d -ctime 0 -exec /bin/rm -Rf...
16,695
Posted By worchyld
Oh... I guess I'll just have to use PHP or...
Oh... I guess I'll just have to use PHP or another solution as I don't have any control over the incoming filename.
16,695
Posted By worchyld
This looks like a good solution, however... it...
This looks like a good solution, however... it states;



So this means that the CSV file has to be named the same as the table -- but what if I want to import into a specific table?

I don't...
10,236
Posted By worchyld
I don't know. And I'm not sure how to check. ...
I don't know. And I'm not sure how to check.

I am using PUTTY on a Windows platform to the server.



This is the best I can do, I don't know how to replicate everything you did in your post....
10,236
Posted By worchyld
Hi there. I tried adding the -depth...
Hi there.

I tried adding the -depth parameter, I even copy/pasted your code. But its still removing the /data/ folder.

[code]
find /path/to/traveldata/data/ -depth ! -name data -type d...
10,236
Posted By worchyld
Sorry but its still removing the data folder. ...
Sorry but its still removing the data folder.


find /path/to/traveldata/data/ -type d ! -name data -ctime 0 -exec /bin/rm -Rf "{}" \;


I get the following output;



NB: The folder does...
10,236
Posted By worchyld
Thanks I will try it right now and report here. ...
Thanks I will try it right now and report here.

Thanks again.
16,695
Posted By worchyld
sh and MySQL LOAD DATA
I have a csv file in a folder that is roughly 500,000 rows long.

Rather than using PHP, I would like to use SH to run a MYSQL LOAD DATA command to load the data in, as I think it would be much...
10,236
Posted By worchyld
Deleting the contents of a folder older than X hours
Every day a new .zip file is uploaded to a folder and at mid-night the zip file is to be extracted into a /data/ folder, inside a date-named folder.


# This should extract the contents of a zip...
Showing results 1 to 21 of 21

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