(Msg. 1) Posted: Wed Sep 24, 2008 12:43 pm
Post subject: add extra line to text file Archived from groups: microsoft>public>win98>apps (more info?)
I'm looking for help editing a text file.
Where the date changes between rows I'd like to insert an extra line.
The first row of the file contains 'Sep 1', so will the second, third
and so on.
Then on maybe the 10th line the date changes to Sep 2 and so will the
next and the next and so on.
I'd like to insert a line break between where the date changes from
Sep 1 to Sep 2. Then I'd like another line break where Sep 2 changes
to Sep 3. I'd like to repeat this throughout the file.
All rows contain Sep.
The date only appears once on each line, but it is not in a fixed
position. I mean it is not always a set number of characters from the
start of the row.
The number of rows on which a date appears is not fixed either. So Sep
1 may appear 10 times, but Sep 2 may only appear 8.
The rows are in date order.
The text of each row is one long string of varying length.
(Msg. 2) Posted: Wed Sep 24, 2008 11:12 pm
Post subject: Re: add extra line to text file [Login to view extended thread Info.] Archived from groups: per prev. post (more info?)
On Wed, 24 Sep 2008 12:43:23 -0700 (PDT), ciaran.hudson.RemoveThis@gmail.com wrote:
>I'm looking for help editing a text file.
>
>Where the date changes between rows I'd like to insert an extra line.
>
>The first row of the file contains 'Sep 1', so will the second, third
>and so on.
>
>Then on maybe the 10th line the date changes to Sep 2 and so will the
>next and the next and so on.
>
>I'd like to insert a line break between where the date changes from
>Sep 1 to Sep 2. Then I'd like another line break where Sep 2 changes
>to Sep 3. I'd like to repeat this throughout the file.
>
>All rows contain Sep.
>
>The date only appears once on each line, but it is not in a fixed
>position. I mean it is not always a set number of characters from the
>start of the row.
>
>The number of rows on which a date appears is not fixed either. So Sep
>1 may appear 10 times, but Sep 2 may only appear 8.
>
>The rows are in date order.
>
>The text of each row is one long string of varying length.
>
>All help greatly appreciated.
There's a program called AWK that can probably do that. I'm not sure if Word
can.
(Msg. 3) Posted: Mon Sep 29, 2008 3:09 am
Post subject: Re: add extra line to text file [Login to view extended thread Info.] Archived from groups: per prev. post (more info?)
On Wed, 24 Sep 2008 12:43:23 -0700 (PDT), ciaran.hudson RemoveThis @gmail.com put
finger to keyboard and composed:
>I'm looking for help editing a text file.
>
>Where the date changes between rows I'd like to insert an extra line.
>
>The first row of the file contains 'Sep 1', so will the second, third
>and so on.
>
>Then on maybe the 10th line the date changes to Sep 2 and so will the
>next and the next and so on.
>
>I'd like to insert a line break between where the date changes from
>Sep 1 to Sep 2. Then I'd like another line break where Sep 2 changes
>to Sep 3. I'd like to repeat this throughout the file.
>
>All rows contain Sep.
>
>The date only appears once on each line, but it is not in a fixed
>position. I mean it is not always a set number of characters from the
>start of the row.
>
>The number of rows on which a date appears is not fixed either. So Sep
>1 may appear 10 times, but Sep 2 may only appear 8.
>
>The rows are in date order.
>
>The text of each row is one long string of varying length.
>
>All help greatly appreciated.
>
>Regards,
>Ciarán
This type of question may be better answered in alt.msdos.batch. Apart
from AWK, there is also SED.
- Franc Zabkar
--
Please remove one 'i' from my address when replying by email.
All times are: Eastern Time (US & Canada) (change)
Page 1 of 1
You can post new topics in this forum You can reply to topics in this forum You can edit your posts in this forum You can delete your posts in this forum You can vote in polls in this forum