How to delete space in beginning of each line

2,408 views
Skip to first unread message

josh

unread,
Jun 2, 2010, 3:22:34 PM6/2/10
to TextWrangler Talk
Hi!
I was sent a big file with e-mails. All the e-mails have a space
before the e-mail
Ex:
123...@aol.com
zzk...@gmail.com

Should be:
123...@aol.com
zzk...@gmail.com
(space in beginning of line was removed)

Any function to do that for all the document at once?

Thanks!

Mark Slater

unread,
Jun 2, 2010, 4:19:00 PM6/2/10
to textwr...@googlegroups.com
Open your file, then hit CMD-f

Then in the Find: box write "\r " <- note extra space after the "r"

In the Replace: box write "\r" <- note the missing space after the "r"

Then click "Replace all".

> --
> You received this message because you are subscribed to the
> "TextWrangler Talk" discussion group on Google Groups.
> To post to this group, send email to textwr...@googlegroups.com
> To unsubscribe from this group, send email to
> textwrangler...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/textwrangler?hl=en
> If you have a feature request or would like to report a problem,
> please email "sup...@barebones.com" rather than posting to the group.

--
slater

josh

unread,
Jun 2, 2010, 5:00:49 PM6/2/10
to TextWrangler Talk
Thanks For the Quick Response Mark!

On Jun 2, 4:19 pm, Mark Slater <mark.sla...@gmail.com> wrote:
> Open your file, then hit CMD-f
>
> Then in the Find: box write "\r " <- note extra space after the "r"
>
> In the Replace: box write "\r" <- note the missing space after the "r"
>
> Then click "Replace all".
>
>
>
> On Wed, Jun 2, 2010 at 3:22 PM, josh <joasous...@gmail.com> wrote:
> > Hi!
> > I was sent a big file with e-mails. All the e-mails have a space
> > before the e-mail
> > Ex:
> >  1234...@aol.com
> >  zzka...@gmail.com
>
> > Should be:
> > 1234...@aol.com
> > zzka...@gmail.com
> > (space in beginning of line was removed)
>
> > Any function to do that for all the document at once?
>
> > Thanks!
>
> > --
> > You received this message because you are subscribed to the
> > "TextWrangler Talk" discussion group on Google Groups.
> > To post to this group, send email to textwr...@googlegroups.com
> > To unsubscribe from this group, send email to
> > textwrangler...@googlegroups.com
> > For more options, visit this group at
> >http://groups.google.com/group/textwrangler?hl=en
> > If you have a feature request or would like to report a problem,
> > please email "supp...@barebones.com" rather than posting to the group.
>
> --
> slater

Christopher Bort

unread,
Jun 2, 2010, 6:13:35 PM6/2/10
to textwr...@googlegroups.com
On 06/02/10 13:19, mark....@gmail.com (Mark Slater) wrote:

>Open your file, then hit CMD-f
>
>Then in the Find: box write "\r " <- note extra space after the "r"
>
>In the Replace: box write "\r" <- note the missing space after the "r"
>
>Then click "Replace all".

A more general option would be to enable Grep in the Find dialog
and use:

find pattern: ^ * [with a space between ^ and *]
replace pattern: [empty]

The * in the find pattern will make it match any number of
spaces at the beginning of a line. If you want to remove only
the first space, omit the *.

If you want to remove all white space characters (space, tab,
etc.) from the beginning of lines, rather than just spaces, use
^\s* for the find pattern.

>On Wed, Jun 2, 2010 at 3:22 PM, josh <joaso...@gmail.com> wrote:
>>Hi!
>>I was sent a big file with e-mails. All the e-mails have a space
>>before the e-mail
>>Ex:
>> 123...@aol.com
>> zzk...@gmail.com
>>
>>Should be:
>>123...@aol.com
>>zzk...@gmail.com
>>(space in beginning of line was removed)
>>
>>Any function to do that for all the document at once?
>>
>>Thanks!
>>
>>--
>>You received this message because you are subscribed to the
>>"TextWrangler Talk" discussion group on Google Groups.
>>To post to this group, send email to textwr...@googlegroups.com
>>To unsubscribe from this group, send email to
>>textwrangler...@googlegroups.com
>>For more options, visit this group at
>>http://groups.google.com/group/textwrangler?hl=en
>>If you have a feature request or would like to report a problem,
>>please email "sup...@barebones.com" rather than posting to the group.

--
Christopher Bort
<top...@thehundredacre.net>
<http://www.thehundredacre.net/>
Skype: topherbort

gmail

unread,
Jun 2, 2010, 9:17:36 PM6/2/10
to textwr...@googlegroups.com
Tip.

Check out the "Use selection for Find" (Command + E)

Main Menu, Search.

Lee

Reply all
Reply to author
Forward
0 new messages