It appears you have not yet registered with DEVPPL. To register please click here... (it's fast, easy and free!)

Forum

Log In Sponsors
Board index Programming CGI and Perl Forum

Replace first blank space with character

Replace first blank space with character

Postby Tedh on Fri Aug 27, 2010 7:39 pm

A file contains a lot of lines and I need to insert a pipe at the first blank space.

There's plenty about deleting, replacing all blank spaces on the web etc-etc, but I could not find anything that relates to what I need to do (seems to be a common occurence for me :roll: ).

Existing file
0010001 A line of text.
0010002 Something else to say.
0010003 More words and another sentence.
0010004 And the words go on.

How would I end up with this0
0010001|A line of text.
0010002|Something else to say.
0010003|More words and another sentence.
0010004|And the words go on.

Hope someone can help, thanks.
Tedh
 
Posts: 7
Joined: Mon Aug 10, 2009 9:27 pm

Re: Replace first blank space with character

Postby Tedh on Sat Sep 04, 2010 6:01 pm

Solved
Tedh
 
Posts: 7
Joined: Mon Aug 10, 2009 9:27 pm


Who is online

Users browsing this forum: No registered users and 0 guests