cdlvj,
in your sample, it looks like only portion of the file got read (by substr) and sent. how repeat/loop to send entire file? this is what i currently have:
...
while ( read( OpenedFile, $file, $myBufferSize ) ) {
# print $socket substr($file,0,512);
# print $socket substr($file,512,512)...
anyone else have any suggestion? Kirsle comment seems incorrect:
he maximum packet size (also called the MTU, or Maximum Transmission Unit) and default packet size can vary depending on the media. For ethernet (LAN), the max packet size is 1500 octets. For dialup, it is 576 octets. For token...
i am openning a file and printing it to a socket. what i want to do is to be able to control the chunk size of the packet being sent (ie. 128K or 512K or 1024K etc...), how can i do this? thx
Thank you for your reply.
Yes, this helped. I was thinking of use perl's grep function (from a win32 environment...).
But i am not there yet, your code will put the entire line containing the matched string in the array @f. Is there a way to get just the matching string (which is a single word...
hello,
i would like to search a file to see if a specific string exist and return true or false. not sure how to use grep within perl, is this possible? please help.
thanks.
the problem: I backup a 32-bit setup application to a CD; i notice the app no longer retain the original icon, when run it runs in dos and fail 'program too big to fit in memory'
any idea to resolve issue?
By using the example below, this seem to be working fine for me and does what I wanted:
sed '/-a[0-9]*/s/-a/-B aa=/g'
Thank you, jamisar, for your assistance and effort.
We can end this post for now I will re-post if this give me any problem.
Thank you, jamisar, for replying to my post.
In the solution you provided, the substitution would appears to work (I have not actually try it yet) because the number, "23", is known; but what if I do not know the number following the -a<###> ahead of time, how would I approach that...
I have the following line in a file:
word1 -a<follow by some number here> word2
(eg: word1 -a23 word3)
I need to change "-a23" to "-B aa=23". I am having a hard time trying to get this done in sed. Could someone please help.
Due to other substitution in my script done by...
Yes the import.txt file is uploaded to the same directory that the php script is executing from (which is on the same machine that is hosting the apache and mysql).
So you do think I need to add the 'mysql_init' and 'mysql_options' functions into my php script?
OK, so I have this problem with MySQL 3.23.53 (win2k) and Apache2.0.43(running as module) and PHP4.3.0(dev) (this is necessary for Apache2.0.43 to run as module; php bug). I have a script that load data from a csv file into a DB. The problem is in newer version of MySQL 'LOAD DATA LOCAL INFILE'...
Okay, finally found the problem: One of the field (field_b)in the table is datatype int(255) and default is NULL and unique. The problem is the statement:
$result = mysql_db_query($sql_db,"LOAD DATA LOCAL INFILE './db_upload/import.txt' INTO TABLE table1 FIELDS TERMINATED BY ',' ENCLOSED...
When trying to use 'LOAD DATA LOCAL INFILE' with Apache2.0.43 (running a module) and MySQL 3.23.53, it return the error the command is not supported. This is because the function is disable for security issue, but when I tried to start mysql with 'c:\mysql\bin\mysqld-nt --local-infile=1' it...
Still does not work.
I tried without the "enclosed by" clause and it still does not process all the lines, only the first line gets inserted into the table.
I tried to see if there is any newline \n or carriage return \r in the file at the end of each line, and in fact od (octal dump - a unix utilities for ms shell 2.x) does shows \n and \r (0001420 5 , 2 \r \n) but not sure why this line:
$result = mysql_db_query($sql_db,"LOAD DATA...
I have a csv file saved from Excel that I am trying to import into a mysql table. The problem is that only the first line gets inserted, the rest of the file is not inserted into table1.
This is the mysql command that is processing the file:
$result = mysql_db_query($sql_db,"LOAD DATA...
sleipnir214,
Thank you. Yes, that is what I needed. You just have all the answer :-) . And I was about to attempt to use 'in_array' function to walk through and check for repeating string when I have to idea if in_array is appropriate for the task and no very strong on coding.
As someone once...
Well, I am not sure but let me try to explain.
So I have a table (t1) with ~100 rows and in one of the column (c3)contains one of the following value (blank,type1,type2,type3...). So I would like the selection box to have the name of each item only once. What I have so far will populate all the...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.