User Profile
Collapse
-
it is text file, separated by the new line character -
Read A Line with 8 bytes of data from a file
Can anyone let know how to read a line with maximum of 8 bytes from a line in a file.
Let say line has 10248 bytes in one single line and same repeats for remaining lines in the file.
I need to read the first 8 bytes of a line and go on read the last 2 bytes of the line and repeat the till end of file.
Regards,
Neeru -
neeru29 started a topic How to read a line of unknown lenght from a file by using dynamic memory allocationin CHow to read a line of unknown lenght from a file by using dynamic memory allocation
I have file, with no of lines. size of of line is unknown.
I want to read one line at a time.
I have tried it by using fgets() function, I was able to read apart of the first line and so on...
Can anyone help me on this..
regards,
neeru -
Split a line by whilespace or tabcharacter (\t)
Hi,
I have file in while following line are present
dir1 dir2 dir3 dir2 file1 file2
dir1_file1 dir1_file2\tdir 2_file1 dir2_file2\tdir 3_file1
...
...
reading a one line at a time from a file,
i'm using the function strtok_r() to split the each line with delimiter whilespace and '\t' character.
How can differentiate that 2 words are split by whitespace or... -
-
Split a single file into multiple files
I have file with 1000 lines. for example:
..
..
01-06 00:02:33.459 I/Activity( 32): Starting: {....APTPower}
..
..
..
..
01-06 00:02:34.563 I/Activity( 32): Starting: {....APTPower}
...
...
..
..
01-06 00:03:21.459 I/Activity( 32): Starting: {....APTPower}
..
..
I want to split file where ever Starting & APTPower occurs and writing... -
i got it by using multiple malloc calls.. i want it by single malloc callLeave a comment:
-
I had tried with the following statement to allocate memory to 2D array:
Code:arr2D = (int **)malloc(row * sizeof(int *) + row * col * sizeof(int)); for(i = 0; i< row; i++) { for(j=0; j< col; j++) { scanf("%d", &a[i][j]); // here the memory segmentation is displayed. } }
Leave a comment:
-
Dynamic allocation of memory to 2 dimensional Array in a Single malloc Call
To allocate a 2D array of integers, in such a way that the array elements can be accessed with a[i][j] syntax i.e., should not use pointers to access the values.
Note: The function should perform only a single malloc call.
The function declaration is:
int **alloc_array( int nrows, int ncols); -
Reading content of file into variable and splitting into an array
hello,
i'm trying to read the content of file into the variable at once. It has been successful. But how can i split each new line into array.
Let us assume the file contains the following line
192.114.82.90 - - [01/Nov/1998:00:32:54 +0200] www.actcom.co.il "GET /~choo/lupg/images/good_bar.gif HTTP/1.0" 404 -
192.114.82.90 - - [01/Nov/1998:00:33:03 +0200] www.actcom.co.il "GET /~choo/lupg/images/good_bar.gif... -
-
yaa sure....
Code:import time the_time = time.time() Timer_Counter = 30 def sample(request) global the_time elapsed_time = time.time() - the _time if elapsed_time < 0 do.....something or call a function the_time() = time.time()
Here the Sample function runs in infinite loop.
after every 30 seconds the some other...Leave a comment:
-
-
how to Running a particular funtion at a regular interval of time
I'm executing two function in a program in a infinite loop.
In that loop i want run a particular a particular function which is out side the function, but that function also runs simultaneously with that function.
when i tried with the threading.Timer (), the function that is to be executed, it throws an exception as cannot start another thread of that function. As that function is already running in the loop.... -
-
Need a help on list....
Let us assume that we have 4 different list which are independent of each other, But value in it are dependent of each other.
Say:-
List1 = [ ]
List2 = [ ]
List3 = [ ]
List4 = [ ]
i.e
value at List4[5] dependent with List1[5], List2[5], List3[5]
If i'm sorting List4 i don't want to loose the dependency of the values which are interconnected.
... -
How to extract a Payload data and IP addresses from a captured packet
I'm using Pcapy and impacket module for packet sniffer.
I'm able to capture the whole data in a variable and display it.
I want extract the IP addresses , Port no's and Payload data into separate variable and display it.
code is as follows:
Code:import sys import string from threading import Thread import pcapy from pcapy import findalldevs, open_live import impacket from
-
no, these values are not used for the human reading........ ..
By using the pickling can I store the dictionary into the database......Leave a comment:
-
thxs,..
But i'm trying to store the dictionary to database, but the database doesn't support to store the dictionary. as i had to convert the dictionary to string...Leave a comment:
-
No activity results to display
Show More
Leave a comment: