![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks. |
| |||||||
![]() |
| |
| | #1 (permalink) |
| | Text processing problem Hi, I'd really appreciate a steer on how best to accomplish this text processing conundrum in Powershell. I have a large text file full of this:- IDENTITY 1234 ANY IDSS 03035 XXXX 8 NAME 00 63636 NAME 01 64646 NAME 02 76767 NAME 03 87878 NAME 04 NAME 05 22121 NAME 06 NAME 07 11222 NAME 08 NAME 09 22122 IDENTITY 1235 ANY IDSS 03035 XXXX 8 NAME 00 54545 NAME 01 32322 NAME 02 67523 NAME 03 NAME 04 67887 NAME 05 23221 NAME 06 I need each NAME to be preceded by it's IDENTITY number. Like this:- IDENTITY 1234 ANY IDSS 03035 XXXX 8 1234 NAME 00 63636 1234 NAME 01 64646 1234 NAME 02 76767 1234 NAME 03 87878 1234 NAME 04 1234 NAME 05 22121 1234 NAME 06 1234 NAME 07 11222 1234 NAME 08 1234 NAME 09 22122 IDENTITY 1235 ANY IDSS 03035 XXXX 8 1235 NAME 00 54545 1235 NAME 01 32322 1235 NAME 02 67523 1235 NAME 03 1235 NAME 04 67887 1235 NAME 05 23221 1235 NAME 06 And so on. There are maye a hundred or so lists like this in the file that need this treatment. I'd be really grateful for any assistance. Many thanks, Stuart |
My System Specs![]() |
| | #2 (permalink) |
| | Re: Text processing problem Marco, Thats awesome! Brilliant use of switch/regex. I wish I coulda thought of it ! Many thanks, Stuart |
My System Specs![]() |
![]() |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Forum | |||
| Word Processing problem? :S | Software | |||
| More text processing. | PowerShell | |||
| Clear-Content Cmdlet and Processing Lines in Text File | PowerShell | |||
| ACT! Word Processing Problem? | Vista General | |||
| Unique error problem - "Some errors occurred while processing -" | Vista mail | |||