I am having a file, around 500 lines. which contains one letter words, two letters words,...and so on(up to 15 letter words and words are not seprated by line). I need to compare all 1 letter words with 3,4,5 and 6 letters word, all 2 letters words with 2,3,4 and 5 letters words and all 3 letters word with 3 and 4 letters words. For this i wrote a program in C and shell script, my logic is
*)use awk and shell script to create six different files. file1 for 1 letter words, file2 for 2 letters words ..so on and file6 for six letters words.
*) In every file first line contains number of words in that file.
*)read each file line by line and since i already know the number of words in the file assign dynamic memory to store them in 2D char arrays.
*)For each word in 2d arrays compare as mentioned above.
part of my code:
But it is to slow. Can anyone suggest me better way of doing this. Thanks in advance.
Last edited by Franklin52; 07-14-2011 at 05:36 PM..
Reason: Please use code tags for data and code samples, thank you
My input file is an XML and it has some tags and data rows at end.
Starting of data rows is <rs:data> and ending of data rows is </rs:data>.
Within sample data rows (2 rows) shown below, I want to extract data value after equal to sign (until space or "/" sign).
So if XML data... (7 Replies)
I want to extract blocks of data from a file depending on the contents of that block.
The input file(table) has several blocks each starting with 'gene' in the first column. I want to extract only those blocks which do not have the expression '_T02' in the second column.
Input file ... (3 Replies)
I am trying to compare the data in lines 3 & 5 to see if they match up to the '-S570' (see first code set, all proprietary information has been removed from code set)
Connected to CA-LOS1234-ASE-S570.cl .
Escape character is '^]'.
Username: ... (1 Reply)
This is my first post in here, so excuse me if I sound too noob here!
I need to extract the path "/apps/mp/installedApps/V61/HRO/hrms_01698_A_qa.ear" from the below xml extract. The path will always appear with the key "binariesURL"
<deployedObject... (6 Replies)
Please can someone assist.
I have the following xml file:
<?xml version="1.0" encoding="utf-8" ?>
- <PUTTRIGGER xmlns:xsd="http://www.test.org/2001/XMLSchema" xmlns:xsi="http://www.test.org/2001/XMLSchema-instance" APPLICATIONNUMBER="0501160" ACCOUNTNAME="Mrs S Test"... (15 Replies)
I have a file which stores the following array :-
This file has few hundreds of inputs of these lines.
I would like to read this file one line at a time; and assign to an array which is separated by ",".
I tried to do fgets command however,... (10 Replies)
I need to calculate the number of occurrences of a item in a number of files using Perl.
The item appears continually throughout the files but in each case I only want to calculate it in certain blocks of the file.
Example - Calculalte the number of occurrences of a 'pass' in a block of... (0 Replies)
Hi ppl out there...
Can anyone help me with the shell script to extract data from an xml file.
My xml file looks like :
... (3 Replies)
Anybody any idea how to extract data from an AFP file using UNIX commands?
I could make the AFP to PDF or if there is any other to change it to to make the extraction simplar. I'm open to ideas.
Cheers (4 Replies)