Afficher un message
Vieux 01/11/2006, 21h09   #1
NoManKey
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut sed replace first five chars

Hi - I have a file that contains a series of fields that I need to
retain but into which I need to insert a new field.

The new field has to be the first field and consist of 8 characters
broken down as a five digit number (preferably starting as 00001)
followed by 3 spaces. The number being inserted into the first field
needs to be incremented on each subsequent line.

Is this a simple one or trickier than it sounds???

example structure - fixed field lengths (12,12,11,12)
874647864 Alan 01/01/06 comment1
874667865 Harry 01/10/06 comment2
874697866 malcolm 10/01/06 comment3

required structure (8,12,12,11,12)
00001 874647864 Alan 01/01/06 comment1
00002 874667865 Harry 01/10/06 comment2
00003 874697866 malcolm 10/01/06 comment3

TIA

  Réponse avec citation
 
Page generated in 0,06084 seconds with 9 queries