View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default Most Interesting Problem I Had Ever Got.

Your example shows a is missing in row 3, but there are not spaces to mark
it missing. Same with the rest of your example. The only line that has two
adjacent spaces is line 5.

col1 col2 col3 col4
a b c d
b c d
a b d
a c d

For anyone to help, you need an accurate depiction of the actual file.

--
Regards,
Tom Ogilvy



"Ussiddiqui " wrote in message
...
*ONLY WELL EQUIPED PEOPLE REQUIRED TO SOLVE IT *
MOST INTERESTIN PROBLEM I HAD EVER GOT : I WILL SAY THE PERSON
CHAMPION OF THIS FORUM WHO WILL SOLVE IT , IF YOU HAVE ANY QUESTIONS OR
QUERIS PLEASE REPLY.

Sanario : i want to convert a text file in to excel sheet , there are
no dilimiters nothing specified, just this thing is specified that
there are more spaces between the columns, this sanario is also
rechognized by me, hay listen when i want to judge that i am reading
words , every thing with a single space is considered as a word. isent
it interesting :-)

I had used this technique , here is given steps of construction

a) open the text file
b) read a data line
c) split the data line in an array with space delimiter or DEFAULT
delimiter
now this array will be somthing intersting, words in this array, or
every word in this array will be on consecitive locations , hope you
understand that, and when we find that there are many locations of
spaces between the filled array locations, i consider that columns are
started comming, Actually this is approximation ,because my client is
not helping me out. so you people have to help me out.

d) write the data in to the excel sheet columns .
c) Increment the column when you find (number of spaces ) in the array
, otherwise write the words from the array in to the current row and
the current location.


Hay tell me this thing that is this possible here is a line


Problem area :
col1 col2 col3 col4
a b c d
b c d
a b d
a c d



Q : Now tell me that how you are doing this
A : i pick up this line ( col1 col2 col3 col4 ) and apply an algorighem
on that is based on approximation i had assumed that words containing
space are same words, but when there are lots of spaces between the
columns then it means that these are different columns. ok i read this
line now the shape of the array will be like thre will be a on first
loc then spaces , i mean constant spaces, then again b and again
constant spaces , then again c and constant spaces again and then
again d , there comes a situation where i find some missing columns
means as in row number 3 of above data given ,

WINNING QUESTION :
Can any buddy tell me that how can i go to konow that a missing
column below a is detected. , i know its hard for you all , to
understand this problem, any person having easier technique then this
can be the winner. ( for sure ) , so reply ASAP .


My expected solution : ( but not very good)
i will check that when i will start reading columns, i will check
that how how many space sequences are there between the columns. and
when i will find that this number has decreased then i will do this
find that where the column is missing ,
is it a first column
is it a second column
is it a third column
And then i will put an extra column in the excel sheet for that
perticular position .
Please help me out, it is one of some interesting problems that i had
found


---
Message posted from http://www.ExcelForum.com/