Win98banter

Win98banter (http://www.win98banter.com/index.php)
-   Software & Applications (http://www.win98banter.com/forumdisplay.php?f=4)
-   -   add extra line to text file (http://www.win98banter.com/showthread.php?t=44643)

[email protected] September 24th 08 08:43 PM

add extra line to text file
 
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

Steve Hayes September 24th 08 10:12 PM

add extra line to text file
 
On Wed, 24 Sep 2008 12:43:23 -0700 (PDT), 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.


--
Steve Hayes from Tshwane, South Africa
Web:
http://hayesfam.bravehost.com/stevesig.htm
Blog: http://methodius.blogspot.com
E-mail - see web page, or parse: shayes at dunelm full stop org full stop uk

Franc Zabkar September 28th 08 09:14 PM

add extra line to text file
 
On Wed, 24 Sep 2008 12:43:23 -0700 (PDT), 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 GMT +1. The time now is 06:54 PM.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Win98Banter.com