Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Interesting Formula Problem | Excel Worksheet Functions | |||
Interesting TIF file problem | Excel Discussion (Misc queries) | |||
Interesting Treeview problem. | Excel Programming | |||
Interesting applied spreadsheet problem | Excel Programming |