Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Most Interesting Problem I Had Ever Got.

*ONLY WELL EQUIPED PEOPLE REQUIRED TO SOLVE IT *
MOST INTERESTIN PROBLEM I HAD EVER GOT : I WILL SAY THE PERSO
CHAMPION OF THIS FORUM WHO WILL SOLVE IT , IF YOU HAVE ANY QUESTIONS O
QUERIS PLEASE REPLY.

Sanario : i want to convert a text file in to excel sheet , there ar
no dilimiters nothing specified, just this thing is specified tha
there are more spaces between the columns, this sanario is als
rechognized by me, hay listen when i want to judge that i am readin
words , every thing with a single space is considered as a word. isen
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 DEFAUL
delimiter
now this array will be somthing intersting, words in this array, o
every word in this array will be on consecitive locations , hope yo
understand that, and when we find that there are many locations o
spaces between the filled array locations, i consider that columns ar
started comming, Actually this is approximation ,because my client i
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 arra
, otherwise write the words from the array in to the current row an
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 algorighe
on that is based on approximation i had assumed that words containin
space are same words, but when there are lots of spaces between th
columns then it means that these are different columns. ok i read thi
line now the shape of the array will be like thre will be a on firs
loc then spaces , i mean constant spaces, then again b and agai
constant spaces , then again c and constant spaces again and the
again d , there comes a situation where i find some missing column
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 missin
column below a is detected. , i know its hard for you all , t
understand this problem, any person having easier technique then thi
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 chec
that how how many space sequences are there between the columns. an
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 tha
perticular position .
Please help me out, it is one of some interesting problems that i ha
foun

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

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,885
Default Most Interesting Problem I Had Ever Got.

Hi
not sure I understood you correctly. But lets give it a try. So you
want to put alls words in one column as long as two spaces occur?. If
yes I'd do the folowing:
- Start a word-editor of your choise
- Replace double spaces with a delimiter of your choise (,)
- Import the text an choose this delimiter as separator

If this does not work it would be goot if you can procide a sample data
line from your file an the expected result

HTH
Frank




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Most Interesting Problem I Had Ever Got.

Frank i cant edit the text file , it is somthing generated by a
automated process and we cant do that

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

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,885
Default Most Interesting Problem I Had Ever Got.

But if you convert this text file to Excel you have access to the file
it (e.g. the conversion in Excel will also alter the file). So just
change it first?? (of course create a copy of the original source file)
Though you can do the same principle in Excel using VBA (opening the
file, replacing the double spaces, starting the import)
Frank

Frank i cant edit the text file , it is somthing generated by an
automated process and we cant do that .


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



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Most Interesting Problem I Had Ever Got.

This looks like a good example to use regular expressions to replace the
double spaces by another delimiter.

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Ussiddiqui " wrote in message
...
Frank i cant edit the text file , it is somthing generated by an
automated process and we cant do that .


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





  #6   Report Post  
Posted to microsoft.public.excel.programming
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/



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Interesting Formula Problem Michael Laferriere Excel Worksheet Functions 6 March 9th 07 12:44 AM
Interesting TIF file problem TBird Excel Discussion (Misc queries) 5 July 5th 05 10:32 PM
Interesting Treeview problem. RB Smissaert Excel Programming 1 January 26th 04 06:35 PM
Interesting applied spreadsheet problem Trevor Stokes Excel Programming 4 August 29th 03 12:59 PM


All times are GMT +1. The time now is 12:46 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"