![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !! |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| seeking help in text processing | Alecs | Shell Programming and Scripting | 8 | 04-22-2008 01:17 PM |
| text processing ( sed/awk) | anchal_khare | Shell Programming and Scripting | 12 | 02-29-2008 08:44 AM |
| Have a shell script check for a file to exist before processing another file | heprox | Shell Programming and Scripting | 3 | 11-14-2006 03:26 AM |
| Processing a text file | TheCrunge | UNIX for Dummies Questions & Answers | 1 | 11-09-2005 11:47 AM |
| grep multiple text files in folder into 1 text file? | coppertone | UNIX for Dummies Questions & Answers | 7 | 08-23-2002 02:50 PM |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
text file processing
Hello!
There is a text file, that contains hierarchy of menues, like: Aaaaa->Bbbbb Aaaaa->Cccc Aaaaa-> {spaces} Ddddd (it means that the full path is Aaaaa->Cccc->Ddddd ) Aaaaa-> {more spaces} Eeeee (it means that the full path is Aaaaa->Cccc->Ddddd->Eeeee ) Fffffff->Ggggg Fffffff-> {spaces} Hhhhh (it means that the full path is Fffffff->Ggggg->Hhhhh) Fffffff-> {more spaces} Iiiiiiii (it means that the full path is Fffffff->Ggggg->Hhhhh->Iiiiiiii ) I used $ awk '{if (index ($0, "->")>0){print base $0} else {base = $0}}' j8.txt > j9.txt to get Aaaaa-> and Ffffff-> in front of lines, but it is only one level. How I can get full paths in front of every element? I tried to use egrep with regex '.+-+>+[^ ]+' to find Aaaaa->Bbbbb, Aaaaa->Cccc and Fffffff->Ggggg, but I also need to insert them before... And there are 4 levels.... Maybe piping... Thank you! (I hope everyone can understand what I mean... English is not my native language) |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|