• Post Reply Bookmark Topic Watch Topic
  • New Topic

File Parsing

 
Teena Mariam
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


Hi,
I have a .txt file with the above content. I need to parse this and create the directory structure. Anybody has any pointers on this?

Thanks in Advance,
Teena

[The file and folder names are dummy names. I cant use the exact names.]
 
Teena Mariam
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Does anybody has any idea?

Regards,
Teena
 
Ulf Dittmer
Rancher
Posts: 42970
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What do you have so far? Do you know how to read a text file line by line? Once you have that, you'll need to implement different things depending on whether the fist non-blank character of the line is a "+", a "\" or a "|". You'll need to use various methods of the String class like indexOf, trim and substring.
 
Teena Mariam
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you for the reply. Yes I know how to read a file line by line. I will try the way you said.

Thanks
 
Gerardo Tasistro
Ranch Hand
Posts: 362
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Are those tabs or spaces?
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!