1 Replies - 322 Views - Last Post: 11 September 2009 - 06:51 PM Rate Topic: -----

#1 kayatri  Icon User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 216
  • Joined: 05-May 09

insert specific value before writing line

Posted 11 September 2009 - 06:44 PM

GND P3559 9812, 7993 p9910.26;

GND P3559 9812, 7993 p9910.26;


46N93 P594 40898, 35899 39MIL;

PHY2_P2_CONFIG0 P2767 34205, 33537 39MIL;

18N879 P141 120461, 49324 39MIL;

PMC3_270_ETH1_D0+ P3021 8061, 44624 39MIL;


PCIX_B_PERR# P2586 24661, 53374 50MIL;

IPMC_XTAL1 P195 26161, 86374 50MIL;

JTAG_TDO9_TDI10_R P221 36211, 57124 50MIL;

65N253 P851 77961, 4274 50MIL;

MEM_A_DQ37_R P1866 90911, 25774 50MIL;

i have lines like above in my text file.

i have write all this value in another text file by adding the title.

in my original file's line i must check whether the line contain any MIL value if not, I must write first T1 the below T1 i must write all the line which not contain MIL value until i reach a line which Contain MIL value. If the line contain 39MIL the i must write first T5 then followed by all the line which contain 39MIL until it reach the line which contain another MIL value. Let say 50MIL. the i must write T7 then followed by all the line which contain 50MIL. I sort my original file alredy. so the original file will start from the line which dont have MIL to 39MIL,50MIL,75MIL and 100MIL. Mu output file will look like this
T1


GND P3559 9812, 7993 p9910.26;

GND P3559 9812, 7993 p9910.26;

T5



46N93 P594 40898, 35899 39MIL;

PHY2_P2_CONFIG0 P2767 34205, 33537 39MIL;

18N879 P141 120461, 49324 39MIL;

PMC3_270_ETH1_D0+ P3021 8061, 44624 39MIL;

T7



PCIX_B_PERR# P2586 24661, 53374 50MIL;

IPMC_XTAL1 P195 26161, 86374 50MIL;

JTAG_TDO9_TDI10_R P221 36211, 57124 50MIL;

65N253 P851 77961, 4274 50MIL;

MEM_A_DQ37_R P1866 90911, 25774 50MIL


Is that possible to do. Can any one give me idea on how can do this.

Is This A Good Question/Topic? 0
  • +

Replies To: insert specific value before writing line

#2 mark.bottomley  Icon User is offline

  • D.I.C Addict
  • member icon

Reputation: 176
  • View blog
  • Posts: 990
  • Joined: 22-April 09

Re: insert specific value before writing line

Posted 11 September 2009 - 06:51 PM

2 variables - 1 is last MIL value, one is the current MIL value - if different, writeout the appropriate Tx number before writing the line. - There doesn't appear to be any obvious sequence logic to the Tx numbers that I can see. i.e. what happened to T2, T3, and T4? (T2 was killed in the movie:) )

This post has been edited by mark.bottomley: 11 September 2009 - 07:04 PM

Was This Post Helpful? 0
  • +
  • -

Page 1 of 1