Search found 6 matches

by yigitozen
08 Jun 2012 02:58
Forum: DOS Batch Forum
Topic: Prepending string to each line
Replies: 3
Views: 5496

Re: Prepending string to each line

hi foxidrive, i am trying to build an ant build.xml to include some files. by your help so far, i could achieve to convert: /AS/lib/classes/configuration/ApiMessages.xml into: <classpath codebase="file:/AS/lib/classes/configuration/" archives="ApiMessages.xml" /> thank you, your ...
by yigitozen
08 Jun 2012 02:05
Forum: DOS Batch Forum
Topic: Prepending string to each line
Replies: 3
Views: 5496

Prepending string to each line

Hello, i need a windows batch script to prepend (insert to the beginning) to every line of a file:

string to insert:
"hello"

<input.txt>
dos
tips
forum

<output.txt>
hellodos
hellotips
helloforum

Can you suggest a solution?

Thank you,
Yiğit.
by yigitozen
07 Jun 2012 14:05
Forum: DOS Batch Forum
Topic: Replacing the last occurrence of char on every line of file
Replies: 6
Views: 5140

Re: Replacing the last occurrence of char on every line of f

thank you very much foxidrive, your first code suggested does just what i need. @echo off setlocal enabledelayedexpansion for /f "delims=" %%a in (filein.txt) do ( set "p=%%~pa" set "p=!p:\=/!" >>"fileout.txt" echo !p!" archives="%%~nxa )
by yigitozen
07 Jun 2012 11:18
Forum: DOS Batch Forum
Topic: Replacing the last occurrence of char on every line of file
Replies: 6
Views: 5140

Re: Replacing the last occurrence of char on every line of f

hi foxidrive, performance is not of a big concern. my aim is perform such a conversion: <input.txt> /data/kibris/AS/lib / Administration.jar /data/kibris/AS/lib / Extensions.jar /data/kibris/AS/lib / Batch.jar <output.txt> /data/kibris/AS/lib/ " archives=" Administration.jar /data/kibris/A...
by yigitozen
07 Jun 2012 08:35
Forum: DOS Batch Forum
Topic: Replacing the last occurrence of char on every line of file
Replies: 6
Views: 5140

Re: Replacing the last occurrence of char on every line of f

hi squashman, because i need a portable and native solution which can run on every windows system without an installation. i need to solve it programmatically, not by installing sed for windows, if possible..
any advice?

thanks.
by yigitozen
07 Jun 2012 06:46
Forum: DOS Batch Forum
Topic: Replacing the last occurrence of char on every line of file
Replies: 6
Views: 5140

Replacing the last occurrence of char on every line of file

Hi, i am looking for a windows-batch solution to the problem of, replacing the last occurrence of the given character on each lines of file. the input and the output should be as below: algorithm: replace the last "-" on each line with " AAA " input file: -some-text-here some-mor...