Other Programming Languages
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreOther Programming Languages

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
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  
Old February 26th, 2006, 10:09 AM
Shaitan00 Shaitan00 is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2005
Posts: 17 Shaitan00 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 51 m 32 sec
Reputation Power: 0
Question Adding Text to Text Files [Batch Script]

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,

Reply With Quote
  #2  
Old February 26th, 2006, 10:14 AM
LinuxPenguin's Avatar
LinuxPenguin LinuxPenguin is offline
fork while true;
Dev Shed God 1st Plane (5500 - 5999 posts)
 
Join Date: May 2005
Location: England, UK
Posts: 5,535 LinuxPenguin User rank is General (90000 - 100000 Reputation Level)LinuxPenguin User rank is General (90000 - 100000 Reputation Level)LinuxPenguin User rank is General (90000 - 100000 Reputation Level)LinuxPenguin User rank is General (90000 - 100000 Reputation Level)LinuxPenguin User rank is General (90000 - 100000 Reputation Level)LinuxPenguin User rank is General (90000 - 100000 Reputation Level)LinuxPenguin User rank is General (90000 - 100000 Reputation Level)LinuxPenguin User rank is General (90000 - 100000 Reputation Level)LinuxPenguin User rank is General (90000 - 100000 Reputation Level)LinuxPenguin User rank is General (90000 - 100000 Reputation Level)LinuxPenguin User rank is General (90000 - 100000 Reputation Level)LinuxPenguin User rank is General (90000 - 100000 Reputation Level)LinuxPenguin User rank is General (90000 - 100000 Reputation Level)LinuxPenguin User rank is General (90000 - 100000 Reputation Level)LinuxPenguin User rank is General (90000 - 100000 Reputation Level)LinuxPenguin User rank is General (90000 - 100000 Reputation Level)  Folding Points: 11590 Folding Title: Novice Folder
Time spent in forums: 1 Month 3 Weeks 1 Day 19 h 23 m 58 sec
Reputation Power: 999
Can you please
1-show your code
2-show sample input and expected output

Reply With Quote
  #3  
Old February 26th, 2006, 12:42 PM
Shaitan00 Shaitan00 is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2005
Posts: 17 Shaitan00 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 51 m 32 sec
Reputation Power: 0
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....

Reply With Quote
  #4  
Old February 26th, 2006, 02:28 PM
LinuxPenguin's Avatar
LinuxPenguin LinuxPenguin is offline
fork while true;
Dev Shed God 1st Plane (5500 - 5999 posts)
 
Join Date: May 2005
Location: England, UK
Posts: 5,535 LinuxPenguin User rank is General (90000 - 100000 Reputation Level)LinuxPenguin User rank is General (90000 - 100000 Reputation Level)LinuxPenguin User rank is General (90000 - 100000 Reputation Level)LinuxPenguin User rank is General (90000 - 100000 Reputation Level)LinuxPenguin User rank is General (90000 - 100000 Reputation Level)LinuxPenguin User rank is General (90000 - 100000 Reputation Level)LinuxPenguin User rank is General (90000 - 100000 Reputation Level)LinuxPenguin User rank is General (90000 - 100000 Reputation Level)LinuxPenguin User rank is General (90000 - 100000 Reputation Level)LinuxPenguin User rank is General (90000 - 100000 Reputation Level)LinuxPenguin User rank is General (90000 - 100000 Reputation Level)LinuxPenguin User rank is General (90000 - 100000 Reputation Level)LinuxPenguin User rank is General (90000 - 100000 Reputation Level)LinuxPenguin User rank is General (90000 - 100000 Reputation Level)LinuxPenguin User rank is General (90000 - 100000 Reputation Level)LinuxPenguin User rank is General (90000 - 100000 Reputation Level)  Folding Points: 11590 Folding Title: Novice Folder
Time spent in forums: 1 Month 3 Weeks 1 Day 19 h 23 m 58 sec
Reputation Power: 999
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).

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreOther Programming Languages > Adding Text to Text Files [Batch Script]


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

 Free IT White Papers!
 
Accelerating Trading Partner Performance
One in five. That's how many partner transactions have at least one error. That is an amazing statistic, particularly given the extraordinary leaps in innovation across the global supply chain during the past two decades. Download this white paper to learn more.

 
Competing on Analytics
This Tech Analysis is designed to help identify characteristics shared by analytics competitors, and includes information about 32 organizations that have made a commitment to quantitative, fact-based analysis.

 
Cost Effective Scaling with Virtualization and Coyote Point Systems
An overview of the industry trend toward virtualization, how server consolidation has increased the importance of application uptime and the steps being taken to integrate load balancing technology with virtualized servers.

 
Five Checkpoints to Implementing IP Telephony
Implementation planning for IP PBX software and IP telephony has become vital as businesses replace discontinued legacy PBX phone systems. This informative whitepaper outlines five "checkpoints" for any implementation plan that will help make IP communications a successful proposition.

 
Hosted Email Security: Staying Ahead of New Threats
In the last two years, email has become a fierce battleground between the nefarious forces of spam and malware, and the heroes of messaging protection. The spam volumes increased alarmingly every month, bringing clever new forms of phishing and virus propagation attacks.

 

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway