|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Stop making mediocre tutorials.The best tutorials are video! Camtasia Studio makes it easy to create engaging, buzz-building screen videos at any size, in any popular format. Download the free trial!
|
|
#1
|
|||
|
|||
|
Given two text files:
C:\INFO.TXT XXX.XXX XXXX_XXXX_XXXX_XXXX_XXXX C:\HISTORY.TXT TIMESTAMP XXX.XXX XXXX_XXXX_XXXX_XXXX_XXXX TIMESTAMP XXX.XXX XXXX_XXXX_XXXX_XXXX_XXXX I need a batch file / script that is able to do the following: - Append a “.F53FLIN” to the end of the second line in the INFO.TXT so it looks like “XXXX_XXXX_XXXX_XXXX_XXXX.F53FLIN” - Add 4 lines in the HISTORY.TXT file, a timestamp (when the script is run, now()), and a copy of INFO.TXT with an empty/blank line following it So, in essence I am trying to write a script that adds the .F53FLIN to the INFO.TXT (second line) and a TimeStamp+INFO.TXT+BLANK LINE in the HISTORY.TXT (append to the end). I have tried a few attempts but nothing is coming out even close to right, was hoping someone could help solve the problem. Any hints, ideas, or help would be greatly appreciated, |
|
#2
|
||||
|
||||
|
Can you please
1-show your code 2-show sample input and expected output
__________________
~James [Not currently seeking freelance work] Like philosophy or interested in spirituality? Philosophorum. Game Dev Experts Forums Foresight Linux - Because your desktop should be cool! Linux FAQ FedoraFAQ UbuntuGuide |
|
#3
|
|||
|
|||
|
LinuxPenguin: I don't have any working script/code, I can't seem to figure out how to append to a line nor can I figure out how to add the information into the history file.
A concrete example of INPUTS: C:\INFO.TXT: 1.1 IBb_1.1_LM400_JA1.2.3_1A C:\HISTORY.TXT 02/01/2006 8:33am 1.0 IBa_1.0_LM399_JA1.2.1_1A 02/20/2006 8:33am 1.1 IBb_1.1_LM400_JA1.2.3_1A (the contents of the files are presented below the filename) A concrete example of OUTPUTS after the script is run: C:\INFO.TXT: 1.1 IBb_1.1_LM400_JA1.2.3_1A.F53FLIN C:\HISTORY.TXT 02/01/2006 8:33am 1.0 IBa_1.0_LM399_JA1.2.1_1A 02/20/2006 8:33am 1.1 IBb_1.1_LM400_JA1.2.3_1A 02/26/2006 1:32am 1.1 IBb_1.1_LM400_JA1.2.3_1A.F53FLIN That's it... hope it helps.... |
|
#4
|
||||
|
||||
|
Well the problem is, we have an unofficial policy here: if you haven't shown proof of trying, it's considered homework, and we don't do homework (we can help you with parts of it though).
|
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > Other Programming Languages > Adding Text to Text Files [Batch Script] |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|